Compare commits

..

No commits in common. "1926420695de455194b8a626d98bd058b2bdc2c3" and "b45354416967ec03b835fdb08357449e08de4029" have entirely different histories.

72 changed files with 22451 additions and 18022 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,202 +0,0 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 778f9d79eb2c410482efdc25b248dd46, type: 3}
m_Name: Stage-2.stage-definition
m_EditorClassIdentifier: Assembly-CSharp-Editor::Editor.GON.StageEditor.StageDefinition
id: stage-2.stage-definition
cellSize: 1
floorHeight: 6
activeFloorIndex: 0
stageTag: {fileID: 11400000, guid: ed5f85b3145ce4eabae9b1382f675817, type: 2}
worldSync:
worldLayoutId: 4dac43bfd76a4286a40511c1cce4609b
worldStageId: stage_bd361c8ccbe4421cab5ad85cd71d081a
worldStageDisplayName: Stage 2
worldStageKind: 0
worldLayer: 0
worldTileSize: 24
worldLayerHeight: 24
worldTiles:
- x: 2
y: 0
- x: 3
y: 0
- x: 2
y: 1
- x: 3
y: 1
expectedEndpoints:
- endpointId: endpoint_bb859113836e4b89860e97fb2589a4be
kind: 0
worldTile:
x: 2
y: 1
socketFace: 3
required: 1
connectionId: connection_1099167b7150449491c4cf0d1b4e9b0a
connectedEndpointId: endpoint_d6f5daa321f14376a237ac78ecdeb172
debugLabel: Socket endpoint_bb859113836e4b89860e97fb2589a4be
syncedAt: 2026-06-22T11:40:59.1742480Z
contractVersion: 1
contractHash: 8794a04598a6a1b48d285f5021f6d3c871ebe8bb2f5819ce65ccdf9cd8f0fae4
floors:
- floorId: F0
FloorHeight: 0
cells:
- x: 1
y: 0
structural: 10
- x: -5
y: 3
structural: 10
- x: -5
y: 1
structural: 10
- x: -3
y: 2
structural: 10
- x: 1
y: 1
structural: 10
- x: -4
y: 5
structural: 10
- x: -2
y: 5
structural: 10
- x: -2
y: -2
structural: 10
- x: -2
y: 2
structural: 10
- x: 46
y: 24
structural: 10
- x: -1
y: -2
structural: 10
- x: 0
y: -2
structural: 10
- x: 1
y: -2
structural: 10
- x: -2
y: -1
structural: 10
- x: -5
y: 5
structural: 10
- x: -3
y: 3
structural: 10
- x: -3
y: 0
structural: 10
- x: -1
y: -1
structural: 10
- x: 0
y: -1
structural: 10
- x: -1
y: 5
structural: 10
- x: -3
y: 1
structural: 10
- x: -2
y: 3
structural: 10
- x: -4
y: 0
structural: 10
- x: -5
y: 2
structural: 10
- x: -4
y: 2
structural: 10
- x: -3
y: 5
structural: 10
- x: -1
y: 1
structural: 10
- x: -2
y: 1
structural: 10
- x: -5
y: 4
structural: 10
- x: -4
y: 4
structural: 10
- x: -3
y: 4
structural: 10
- x: -2
y: 4
structural: 10
- x: 0
y: 0
structural: 10
- x: 1
y: -1
structural: 10
- x: -1
y: 3
structural: 10
- x: -4
y: 1
structural: 10
- x: 0
y: 1
structural: 10
- x: -1
y: 2
structural: 10
- x: -4
y: 3
structural: 10
- x: -2
y: 0
structural: 10
- x: -1
y: 0
structural: 10
- x: -1
y: 4
structural: 10
- x: -5
y: 0
structural: 10
- x: -6
y: 0
structural: 10
- x: -6
y: 1
structural: 10
- x: -6
y: 2
structural: 10
- x: -6
y: 3
structural: 10
- x: -6
y: 4
structural: 10
- x: -6
y: 5
structural: 10
objects: []

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 34e040e87b50c47b08f720ae05cd6be3
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -33,40 +33,5 @@ MonoBehaviour:
y: 1 y: 1
- x: 0 - x: 0
y: 1 y: 1
- id: stage_bd361c8ccbe4421cab5ad85cd71d081a endpoints: []
displayName: Stage 2 connections: []
stageKind: 0
worldLayer: 0
color: {r: 0.3231449, g: 0.679588, b: 0.7256679, a: 0.77055603}
stageDefinition: {fileID: 11400000, guid: 34e040e87b50c47b08f720ae05cd6be3, type: 2}
occupiedTiles:
- x: 2
y: 0
- x: 3
y: 0
- x: 2
y: 1
- x: 3
y: 1
endpoints:
- id: endpoint_bb859113836e4b89860e97fb2589a4be
stageId: stage_bd361c8ccbe4421cab5ad85cd71d081a
worldTile:
x: 2
y: 1
kind: 0
required: 1
socketFace: 3
- id: endpoint_d6f5daa321f14376a237ac78ecdeb172
stageId: stage_7f2050e54c664f349472c788bb702cce
worldTile:
x: 1
y: 1
kind: 0
required: 1
socketFace: 2
connections:
- id: connection_1099167b7150449491c4cf0d1b4e9b0a
endpointAId: endpoint_bb859113836e4b89860e97fb2589a4be
endpointBId: endpoint_d6f5daa321f14376a237ac78ecdeb172
directionality: 0

View File

@ -932,17 +932,11 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 86cfe3aa96e541c8998ae79b435d04e5, type: 3} m_Script: {fileID: 11500000, guid: 86cfe3aa96e541c8998ae79b435d04e5, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
defaultCurtainType: {fileID: 11400000, guid: d91043b858654867aaa66b20d678191d, type: 2} defaultCurtainType: {fileID: 0}
starState: 4 starState: 2
containers: containers:
keyData: keyData: []
- {fileID: 11400000, guid: 75f7ecfc567748fc911a909ed8e68a3e, type: 2} valueData: []
- {fileID: 11400000, guid: d91043b858654867aaa66b20d678191d, type: 2}
- {fileID: 11400000, guid: bc9a28f3d7c64606a8b88c91b94e8805, type: 2}
valueData:
- {fileID: 6142202296111551056}
- {fileID: 6746747995563563764}
- {fileID: 7748973705469028213}
--- !u!114 &4829059598325025422 --- !u!114 &4829059598325025422
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0

View File

@ -45,7 +45,6 @@ MonoBehaviour:
m_Name: m_Name:
m_EditorClassIdentifier: Assembly-CSharp::Intrepid.Core.InputManager m_EditorClassIdentifier: Assembly-CSharp::Intrepid.Core.InputManager
subscriptionId: 8f4fe12e750947b8a90870d352933eda subscriptionId: 8f4fe12e750947b8a90870d352933eda
startInputSchema: 0
--- !u!1 &6646150497353767022 --- !u!1 &6646150497353767022
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -202,7 +201,7 @@ MonoBehaviour:
manifest: {fileID: 11400000, guid: d2ff85c9d4e364f50aa65158f0b6daa2, type: 2} manifest: {fileID: 11400000, guid: d2ff85c9d4e364f50aa65158f0b6daa2, type: 2}
inputManager: {fileID: 2567165502544804230} inputManager: {fileID: 2567165502544804230}
configurationPersistenceService: {fileID: 11400000, guid: fd9dae561c8d640df9c516df6a7d3b37, type: 2} configurationPersistenceService: {fileID: 11400000, guid: fd9dae561c8d640df9c516df6a7d3b37, type: 2}
gameDataPersistenceService: {fileID: 11400000, guid: 4715554a8f2cb477bbf691096f0903f9, type: 2} gameDataPersistenceService: {fileID: 0}
gameStateMachine: {fileID: 0} gameStateMachine: {fileID: 0}
--- !u!1 &6646150498879786644 --- !u!1 &6646150498879786644
GameObject: GameObject:
@ -243,6 +242,42 @@ PrefabInstance:
serializedVersion: 3 serializedVersion: 3
m_TransformParent: {fileID: 6646150498868371415} m_TransformParent: {fileID: 6646150498868371415}
m_Modifications: m_Modifications:
- target: {fileID: 112904297142897738, guid: 60638fc6c55d48d9aa9b3889058b8af8, type: 3}
propertyPath: defaultCurtainType
value:
objectReference: {fileID: 11400000, guid: 75f7ecfc567748fc911a909ed8e68a3e, type: 2}
- target: {fileID: 112904297142897738, guid: 60638fc6c55d48d9aa9b3889058b8af8, type: 3}
propertyPath: containers.keyData.Array.size
value: 3
objectReference: {fileID: 0}
- target: {fileID: 112904297142897738, guid: 60638fc6c55d48d9aa9b3889058b8af8, type: 3}
propertyPath: containers.valueData.Array.size
value: 3
objectReference: {fileID: 0}
- target: {fileID: 112904297142897738, guid: 60638fc6c55d48d9aa9b3889058b8af8, type: 3}
propertyPath: 'containers.keyData.Array.data[0]'
value:
objectReference: {fileID: 11400000, guid: 75f7ecfc567748fc911a909ed8e68a3e, type: 2}
- target: {fileID: 112904297142897738, guid: 60638fc6c55d48d9aa9b3889058b8af8, type: 3}
propertyPath: 'containers.keyData.Array.data[1]'
value:
objectReference: {fileID: 11400000, guid: d91043b858654867aaa66b20d678191d, type: 2}
- target: {fileID: 112904297142897738, guid: 60638fc6c55d48d9aa9b3889058b8af8, type: 3}
propertyPath: 'containers.keyData.Array.data[2]'
value:
objectReference: {fileID: 11400000, guid: bc9a28f3d7c64606a8b88c91b94e8805, type: 2}
- target: {fileID: 112904297142897738, guid: 60638fc6c55d48d9aa9b3889058b8af8, type: 3}
propertyPath: 'containers.valueData.Array.data[0]'
value:
objectReference: {fileID: 1955084864098744517}
- target: {fileID: 112904297142897738, guid: 60638fc6c55d48d9aa9b3889058b8af8, type: 3}
propertyPath: 'containers.valueData.Array.data[1]'
value:
objectReference: {fileID: 1422544498137591905}
- target: {fileID: 112904297142897738, guid: 60638fc6c55d48d9aa9b3889058b8af8, type: 3}
propertyPath: 'containers.valueData.Array.data[2]'
value:
objectReference: {fileID: 2708147333427269088}
- target: {fileID: 3242557338744252078, guid: 60638fc6c55d48d9aa9b3889058b8af8, type: 3} - target: {fileID: 3242557338744252078, guid: 60638fc6c55d48d9aa9b3889058b8af8, type: 3}
propertyPath: m_LocalPosition.x propertyPath: m_LocalPosition.x
value: 0 value: 0
@ -292,6 +327,39 @@ PrefabInstance:
m_AddedGameObjects: [] m_AddedGameObjects: []
m_AddedComponents: [] m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 60638fc6c55d48d9aa9b3889058b8af8, type: 3} m_SourcePrefab: {fileID: 100100000, guid: 60638fc6c55d48d9aa9b3889058b8af8, type: 3}
--- !u!114 &1422544498137591905 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 6746747995563563764, guid: 60638fc6c55d48d9aa9b3889058b8af8, type: 3}
m_PrefabInstance: {fileID: 5628557395556330133}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 3be4a1babf654196ac8c01e8df059a13, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &1955084864098744517 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 6142202296111551056, guid: 60638fc6c55d48d9aa9b3889058b8af8, type: 3}
m_PrefabInstance: {fileID: 5628557395556330133}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 3be4a1babf654196ac8c01e8df059a13, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &2708147333427269088 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 7748973705469028213, guid: 60638fc6c55d48d9aa9b3889058b8af8, type: 3}
m_PrefabInstance: {fileID: 5628557395556330133}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 3be4a1babf654196ac8c01e8df059a13, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &5732443498328172255 stripped --- !u!114 &5732443498328172255 stripped
MonoBehaviour: MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 112904297142897738, guid: 60638fc6c55d48d9aa9b3889058b8af8, type: 3} m_CorrespondingSourceObject: {fileID: 112904297142897738, guid: 60638fc6c55d48d9aa9b3889058b8af8, type: 3}

View File

@ -1,85 +0,0 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &119630160975831446
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2270435121348859238}
m_Layer: 0
m_Name: LandingStart
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &2270435121348859238
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 119630160975831446}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 2378040738592165545}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &7631802331149991959
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2378040738592165545}
- component: {fileID: 7503967939848988478}
m_Layer: 0
m_Name: JourneyManager
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &2378040738592165545
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7631802331149991959}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 2270435121348859238}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &7503967939848988478
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7631802331149991959}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: cdf542c2073144c5a39418e08512ca58, type: 3}
m_Name:
m_EditorClassIdentifier: Assembly-CSharp::Intrepid.Gameplay.Journey.JourneyManager
subscriptionId: 5df34d67e6e44f3999042072ea652750
curtainType: {fileID: 11400000, guid: bc9a28f3d7c64606a8b88c91b94e8805, type: 2}
journeyService: {fileID: 11400000, guid: 53f1211059b4847a49bde1be4b8d166c, type: 2}
backStageService: {fileID: 11400000, guid: c58e40006278948db8d8b1f3477f83ea, type: 2}
isRunningTest: 0
stageToTest: {fileID: 0}
landingStart: {fileID: 2270435121348859238}

View File

@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 8cee629b6bf44433f98c6e28031d8f6b
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -12,56 +12,10 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: fcb661d795ed4088af4ae73e4253f98b, type: 3} m_Script: {fileID: 11500000, guid: fcb661d795ed4088af4ae73e4253f98b, type: 3}
m_Name: JGraph-Test01 m_Name: JGraph-Test01
m_EditorClassIdentifier: Assembly-CSharp::Intrepid.Gameplay.Journey.JGraphSO m_EditorClassIdentifier: Assembly-CSharp::Intrepid.Gameplay.Journey.JGraphSO
sourceWorldLayoutId: 4dac43bfd76a4286a40511c1cce4609b sourceWorldLayoutId:
publishedAt: 2026-06-22T11:40:47.6512990Z publishedAt:
schemaVersion: 1 schemaVersion: 1
contentHash: 6224a08985c67c0cf4d2fa4c9e88bf65f4b7137966b8432ed665f62c7c99778d contentHash:
stages: stages: []
- id: stage_7f2050e54c664f349472c788bb702cce endpoints: []
displayName: Stage 1 connections: []
worldLayer: 0
occupiedTiles:
- x: 0
y: 0
- x: 1
y: 0
- x: 1
y: 1
- x: 0
y: 1
tags: []
- id: stage_bd361c8ccbe4421cab5ad85cd71d081a
displayName: Stage 2
worldLayer: 0
occupiedTiles:
- x: 2
y: 0
- x: 3
y: 0
- x: 2
y: 1
- x: 3
y: 1
tags: []
endpoints:
- id: endpoint_bb859113836e4b89860e97fb2589a4be
stageId: stage_bd361c8ccbe4421cab5ad85cd71d081a
worldTile:
x: 2
y: 1
kind: 0
required: 1
socketFace: 3
- id: endpoint_d6f5daa321f14376a237ac78ecdeb172
stageId: stage_7f2050e54c664f349472c788bb702cce
worldTile:
x: 1
y: 1
kind: 0
required: 1
socketFace: 2
connections:
- id: connection_1099167b7150449491c4cf0d1b4e9b0a
endpointAId: endpoint_bb859113836e4b89860e97fb2589a4be
endpointBId: endpoint_d6f5daa321f14376a237ac78ecdeb172
directionality: 0

View File

@ -15,4 +15,3 @@ MonoBehaviour:
journeyGraph: {fileID: 11400000, guid: 992c85dbd199649f48a532195af83aec, type: 2} journeyGraph: {fileID: 11400000, guid: 992c85dbd199649f48a532195af83aec, type: 2}
stagesTags: stagesTags:
- {fileID: 11400000, guid: b0fc23a68ad024c30a531fc69243b2a2, type: 2} - {fileID: 11400000, guid: b0fc23a68ad024c30a531fc69243b2a2, type: 2}
- {fileID: 11400000, guid: ed5f85b3145ce4eabae9b1382f675817, type: 2}

View File

@ -1,22 +0,0 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 6dffc02d596841ba8bb1b992c4899a5f, type: 3}
m_Name: Persistence Game Data
m_EditorClassIdentifier: Assembly-CSharp::Intrepid.Integration.Persistence.GameDataPersistenceService
extraWaiting: 1
fileHandler: {fileID: 11400000, guid: 1deed874fc4f94a079572799b9b16936, type: 2}
configurationPersistenceService: {fileID: 11400000, guid: fd9dae561c8d640df9c516df6a7d3b37, type: 2}
currentGameDataSaveFile:
fileId:
savedAt:
data:
seed:

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 4715554a8f2cb477bbf691096f0903f9
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,15 +0,0 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: ab2e7a683f584962a36a133a6ac88b4a, type: 3}
m_Name: behaviour.can-change-stage
m_EditorClassIdentifier: Assembly-CSharp::Intrepid.Core.Tags.BehaviourTag
code: behaviour.can-change-stage

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 37e6114b7cfc84a13ab29173bdcd4ccf
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because one or more lines are too long

View File

@ -119,7 +119,7 @@ NavMeshSettings:
debug: debug:
m_Flags: 0 m_Flags: 0
m_NavMeshData: {fileID: 0} m_NavMeshData: {fileID: 0}
--- !u!1001 &7036882172617140290 --- !u!1001 &1609485360
PrefabInstance: PrefabInstance:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
serializedVersion: 2 serializedVersion: 2
@ -127,69 +127,112 @@ PrefabInstance:
serializedVersion: 3 serializedVersion: 3
m_TransformParent: {fileID: 0} m_TransformParent: {fileID: 0}
m_Modifications: m_Modifications:
- target: {fileID: 2270435121348859238, guid: 8cee629b6bf44433f98c6e28031d8f6b, type: 3} - target: {fileID: 1110237080051008694, guid: 774b83ee4bf84c4c9b531c2a6350b8a5, type: 3}
propertyPath: m_LocalPosition.x propertyPath: m_IsActive
value: 1 value: 1
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 2270435121348859238, guid: 8cee629b6bf44433f98c6e28031d8f6b, type: 3} - target: {fileID: 6646150498868371415, guid: 774b83ee4bf84c4c9b531c2a6350b8a5, type: 3}
propertyPath: m_LocalPosition.z
value: 1
objectReference: {fileID: 0}
- target: {fileID: 2378040738592165545, guid: 8cee629b6bf44433f98c6e28031d8f6b, type: 3}
propertyPath: m_LocalPosition.x propertyPath: m_LocalPosition.x
value: 0 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 2378040738592165545, guid: 8cee629b6bf44433f98c6e28031d8f6b, type: 3} - target: {fileID: 6646150498868371415, guid: 774b83ee4bf84c4c9b531c2a6350b8a5, type: 3}
propertyPath: m_LocalPosition.y propertyPath: m_LocalPosition.y
value: 0 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 2378040738592165545, guid: 8cee629b6bf44433f98c6e28031d8f6b, type: 3} - target: {fileID: 6646150498868371415, guid: 774b83ee4bf84c4c9b531c2a6350b8a5, type: 3}
propertyPath: m_LocalPosition.z propertyPath: m_LocalPosition.z
value: 0 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 2378040738592165545, guid: 8cee629b6bf44433f98c6e28031d8f6b, type: 3} - target: {fileID: 6646150498868371415, guid: 774b83ee4bf84c4c9b531c2a6350b8a5, type: 3}
propertyPath: m_LocalRotation.w propertyPath: m_LocalRotation.w
value: 1 value: 1
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 2378040738592165545, guid: 8cee629b6bf44433f98c6e28031d8f6b, type: 3} - target: {fileID: 6646150498868371415, guid: 774b83ee4bf84c4c9b531c2a6350b8a5, type: 3}
propertyPath: m_LocalRotation.x propertyPath: m_LocalRotation.x
value: 0 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 2378040738592165545, guid: 8cee629b6bf44433f98c6e28031d8f6b, type: 3} - target: {fileID: 6646150498868371415, guid: 774b83ee4bf84c4c9b531c2a6350b8a5, type: 3}
propertyPath: m_LocalRotation.y propertyPath: m_LocalRotation.y
value: 0 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 2378040738592165545, guid: 8cee629b6bf44433f98c6e28031d8f6b, type: 3} - target: {fileID: 6646150498868371415, guid: 774b83ee4bf84c4c9b531c2a6350b8a5, type: 3}
propertyPath: m_LocalRotation.z propertyPath: m_LocalRotation.z
value: 0 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 2378040738592165545, guid: 8cee629b6bf44433f98c6e28031d8f6b, type: 3} - target: {fileID: 6646150498868371415, guid: 774b83ee4bf84c4c9b531c2a6350b8a5, type: 3}
propertyPath: m_LocalEulerAnglesHint.x propertyPath: m_LocalEulerAnglesHint.x
value: 0 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 2378040738592165545, guid: 8cee629b6bf44433f98c6e28031d8f6b, type: 3} - target: {fileID: 6646150498868371415, guid: 774b83ee4bf84c4c9b531c2a6350b8a5, type: 3}
propertyPath: m_LocalEulerAnglesHint.y propertyPath: m_LocalEulerAnglesHint.y
value: 0 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 2378040738592165545, guid: 8cee629b6bf44433f98c6e28031d8f6b, type: 3} - target: {fileID: 6646150498868371415, guid: 774b83ee4bf84c4c9b531c2a6350b8a5, type: 3}
propertyPath: m_LocalEulerAnglesHint.z propertyPath: m_LocalEulerAnglesHint.z
value: 0 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 7503967939848988478, guid: 8cee629b6bf44433f98c6e28031d8f6b, type: 3} - target: {fileID: 6646150498868371416, guid: 774b83ee4bf84c4c9b531c2a6350b8a5, type: 3}
propertyPath: isRunningTest
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7631802331149991959, guid: 8cee629b6bf44433f98c6e28031d8f6b, type: 3}
propertyPath: m_Name propertyPath: m_Name
value: JourneyManager value: GameManager
objectReference: {fileID: 0} objectReference: {fileID: 0}
m_RemovedComponents: [] m_RemovedComponents: []
m_RemovedGameObjects: [] m_RemovedGameObjects: []
m_AddedGameObjects: [] m_AddedGameObjects: []
m_AddedComponents: [] m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 8cee629b6bf44433f98c6e28031d8f6b, type: 3} m_SourcePrefab: {fileID: 100100000, guid: 774b83ee4bf84c4c9b531c2a6350b8a5, type: 3}
--- !u!1 &1859111548
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1859111550}
- component: {fileID: 1859111549}
m_Layer: 0
m_Name: JourneyManager
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1859111549
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1859111548}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: cdf542c2073144c5a39418e08512ca58, type: 3}
m_Name:
m_EditorClassIdentifier: Assembly-CSharp::Intrepid.Gameplay.Journey.JourneyManager
subscriptionId: 5df34d67e6e44f3999042072ea652750
curtainType: {fileID: 11400000, guid: 75f7ecfc567748fc911a909ed8e68a3e, type: 2}
journeyService: {fileID: 11400000, guid: 53f1211059b4847a49bde1be4b8d166c, type: 2}
backStageService: {fileID: 11400000, guid: c58e40006278948db8d8b1f3477f83ea, type: 2}
isRunningTest: 1
stageToTest: {fileID: 11400000, guid: b0fc23a68ad024c30a531fc69243b2a2, type: 2}
--- !u!4 &1859111550
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1859111548}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1660057539 &9223372036854775807 --- !u!1660057539 &9223372036854775807
SceneRoots: SceneRoots:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
m_Roots: m_Roots:
- {fileID: 7036882172617140290} - {fileID: 1609485360}
- {fileID: 1859111550}

View File

@ -1,183 +0,0 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!29 &1
OcclusionCullingSettings:
m_ObjectHideFlags: 0
serializedVersion: 2
m_OcclusionBakeSettings:
smallestOccluder: 5
smallestHole: 0.25
backfaceThreshold: 100
m_SceneGUID: 00000000000000000000000000000000
m_OcclusionCullingData: {fileID: 0}
--- !u!104 &2
RenderSettings:
m_ObjectHideFlags: 0
serializedVersion: 10
m_Fog: 0
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
m_FogMode: 3
m_FogDensity: 0.01
m_LinearFogStart: 0
m_LinearFogEnd: 300
m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}
m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
m_AmbientIntensity: 1
m_AmbientMode: 0
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0}
m_HaloStrength: 0.5
m_FlareStrength: 1
m_FlareFadeSpeed: 3
m_HaloTexture: {fileID: 0}
m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
m_DefaultReflectionMode: 0
m_DefaultReflectionResolution: 128
m_ReflectionBounces: 1
m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_UseRadianceAmbientProbe: 0
--- !u!157 &3
LightmapSettings:
m_ObjectHideFlags: 0
serializedVersion: 13
m_BakeOnSceneLoad: 0
m_GISettings:
serializedVersion: 2
m_BounceScale: 1
m_IndirectOutputScale: 1
m_AlbedoBoost: 1
m_EnvironmentLightingMode: 0
m_EnableBakedLightmaps: 1
m_EnableRealtimeLightmaps: 0
m_LightmapEditorSettings:
serializedVersion: 12
m_Resolution: 2
m_BakeResolution: 40
m_AtlasSize: 1024
m_AO: 0
m_AOMaxDistance: 1
m_CompAOExponent: 1
m_CompAOExponentDirect: 0
m_ExtractAmbientOcclusion: 0
m_Padding: 2
m_LightmapParameters: {fileID: 0}
m_LightmapsBakeMode: 1
m_TextureCompression: 1
m_ReflectionCompression: 2
m_MixedBakeMode: 2
m_BakeBackend: 2
m_PVRSampling: 1
m_PVRDirectSampleCount: 32
m_PVRSampleCount: 512
m_PVRBounces: 2
m_PVREnvironmentSampleCount: 256
m_PVREnvironmentReferencePointCount: 2048
m_PVRFilteringMode: 1
m_PVRDenoiserTypeDirect: 1
m_PVRDenoiserTypeIndirect: 1
m_PVRDenoiserTypeAO: 1
m_PVRFilterTypeDirect: 0
m_PVRFilterTypeIndirect: 0
m_PVRFilterTypeAO: 0
m_PVREnvironmentMIS: 1
m_PVRCulling: 1
m_PVRFilteringGaussRadiusDirect: 1
m_PVRFilteringGaussRadiusIndirect: 1
m_PVRFilteringGaussRadiusAO: 1
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
m_PVRFilteringAtrousPositionSigmaIndirect: 2
m_PVRFilteringAtrousPositionSigmaAO: 1
m_ExportTrainingData: 0
m_TrainingDataDestination: TrainingData
m_LightProbeSampleCountMultiplier: 4
m_LightingDataAsset: {fileID: 20201, guid: 0000000000000000f000000000000000, type: 0}
m_LightingSettings: {fileID: 0}
--- !u!196 &4
NavMeshSettings:
serializedVersion: 2
m_ObjectHideFlags: 0
m_BuildSettings:
serializedVersion: 3
agentTypeID: 0
agentRadius: 0.5
agentHeight: 2
agentSlope: 45
agentClimb: 0.4
ledgeDropHeight: 0
maxJumpAcrossDistance: 0
minRegionArea: 2
manualCellSize: 0
cellSize: 0.16666667
manualTileSize: 0
tileSize: 256
buildHeightMesh: 0
maxJobWorkers: 0
preserveTilesOutsideBounds: 0
debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
--- !u!1001 &1755564594
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 2378040738592165545, guid: 8cee629b6bf44433f98c6e28031d8f6b, type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2378040738592165545, guid: 8cee629b6bf44433f98c6e28031d8f6b, type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2378040738592165545, guid: 8cee629b6bf44433f98c6e28031d8f6b, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2378040738592165545, guid: 8cee629b6bf44433f98c6e28031d8f6b, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 2378040738592165545, guid: 8cee629b6bf44433f98c6e28031d8f6b, type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2378040738592165545, guid: 8cee629b6bf44433f98c6e28031d8f6b, type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2378040738592165545, guid: 8cee629b6bf44433f98c6e28031d8f6b, type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2378040738592165545, guid: 8cee629b6bf44433f98c6e28031d8f6b, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2378040738592165545, guid: 8cee629b6bf44433f98c6e28031d8f6b, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2378040738592165545, guid: 8cee629b6bf44433f98c6e28031d8f6b, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7631802331149991959, guid: 8cee629b6bf44433f98c6e28031d8f6b, type: 3}
propertyPath: m_Name
value: JourneyManager
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 8cee629b6bf44433f98c6e28031d8f6b, type: 3}
--- !u!1660057539 &9223372036854775807
SceneRoots:
m_ObjectHideFlags: 0
m_Roots:
- {fileID: 1755564594}

View File

@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: dad7814484f1f4cf092e25da270e6d7b
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -13,5 +13,5 @@ MonoBehaviour:
m_Name: Stage 1 m_Name: Stage 1
m_EditorClassIdentifier: Assembly-CSharp::Intrepid.Gameplay.Journey.StageTag m_EditorClassIdentifier: Assembly-CSharp::Intrepid.Gameplay.Journey.StageTag
code: Stage 1 code: Stage 1
stageId: stage_7f2050e54c664f349472c788bb702cce stageId:
localization: {fileID: 0} localization: {fileID: 0}

File diff suppressed because one or more lines are too long

View File

@ -1,17 +0,0 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 05ed6f9811ad495c85269adab82741b3, type: 3}
m_Name: Stage 2
m_EditorClassIdentifier: Assembly-CSharp::Intrepid.Gameplay.Journey.StageTag
code: Stage 2
stageId: stage_bd361c8ccbe4421cab5ad85cd71d081a
localization: {fileID: 0}

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: ed5f85b3145ce4eabae9b1382f675817
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because one or more lines are too long

View File

@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 10ec588ad628146c7937abc5d4a4e656
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -15,14 +15,15 @@ namespace Editor.GON.StageEditor.Baker
public static GameObject Bake(StageDefinition stage, PrefabTable prefabTable) public static GameObject Bake(StageDefinition stage, PrefabTable prefabTable)
{ {
if (stage.IsNull())
{
DLogger.LogWarn("Cannot bake: no StageDefinition selected.");
return null;
}
stage.EnsureDefaults(); stage.EnsureDefaults();
var scene = SceneManager.GetSceneByName(stage.stageTag.SceneName); var scene = SceneManager.GetActiveScene();
var isSceneLoaded = scene.isLoaded;
if (!isSceneLoaded)
{
scene = EditorSceneManager.OpenScene(scene.path, OpenSceneMode.Additive);
}
var generatedRoot = EnsureGeneratedRoot(scene); var generatedRoot = EnsureGeneratedRoot(scene);
Undo.RegisterCreatedObjectUndo(generatedRoot, "Create Generated Root"); Undo.RegisterCreatedObjectUndo(generatedRoot, "Create Generated Root");
var stageRoot = EnsureStageRoot(stage, generatedRoot); var stageRoot = EnsureStageRoot(stage, generatedRoot);
@ -35,16 +36,7 @@ namespace Editor.GON.StageEditor.Baker
Undo.RegisterCreatedObjectUndo(stageRoot, "Create Stage Root"); Undo.RegisterCreatedObjectUndo(stageRoot, "Create Stage Root");
EditorSceneManager.MarkSceneDirty(scene); EditorSceneManager.MarkSceneDirty(scene);
if (isSceneLoaded) Selection.activeGameObject = stageRoot;
{
Selection.activeGameObject = stageRoot;
}
else
{
EditorSceneManager.SaveScene(scene);
EditorSceneManager.CloseScene(scene, false);
}
DLogger.LogDebug($"Bake started for stage '{stage.Id}'. State root is ready."); DLogger.LogDebug($"Bake started for stage '{stage.Id}'. State root is ready.");
return stageRoot; return stageRoot;

View File

@ -2,7 +2,6 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using Intrepid.Diagnostics; using Intrepid.Diagnostics;
using Intrepid.Gameplay.Flooring;
using Intrepid.Gameplay.Prototyping; using Intrepid.Gameplay.Prototyping;
using Temporary; using Temporary;
using UnityEditor; using UnityEditor;

View File

@ -56,7 +56,6 @@ namespace Editor.GON.StageEditor
public float cellSize = 1f; public float cellSize = 1f;
public float floorHeight = 6f; public float floorHeight = 6f;
public int activeFloorIndex; public int activeFloorIndex;
public StageTag stageTag;
public StageWorldSyncData worldSync = new(); public StageWorldSyncData worldSync = new();

View File

@ -377,17 +377,6 @@ namespace Editor.GON.StageEditor
return; return;
} }
if (stage.stageTag.IsNull())
{
EditorUtility.DisplayDialog(
"Bake Stage",
"Select StageTag to the stage before baking.",
"OK"
);
return;
}
if (prefabTable is null) if (prefabTable is null)
{ {

View File

@ -12,16 +12,14 @@ namespace Intrepid.Core.Camera
[GroupInjections, SerializeField] private UnityEngine.Camera mainCamera; [GroupInjections, SerializeField] private UnityEngine.Camera mainCamera;
[GroupInjections, SerializeField] private CinemachineBrain cinemachineBrain; [GroupInjections, SerializeField] private CinemachineBrain cinemachineBrain;
[GroupInjections, SerializeField] private CameraBoundaryManager cameraBoundaryManager; [GroupInjections, SerializeField] private CameraBoundaryManager cameraBoundaryManager;
private bool IsBlendClearing { get; set; } private bool IsBlendClearing { get; set; }
public CameraStreamStack CurrentCameraStreamStack { get; private set; } public CameraStreamStack CurrentCameraStreamStack { get; private set; }
public bool IsCameraBlending => cinemachineBrain.IsBlending; public bool IsCameraBlending => cinemachineBrain.IsBlending;
public float NormalAngle => mainCamera.transform.rotation.eulerAngles.z; public float NormalAngle => mainCamera.transform.rotation.eulerAngles.z;
public UnityEngine.Camera MainCamera => mainCamera; public UnityEngine.Camera MainCamera => mainCamera;
public CameraBoundaryManager CameraBoundaryManager => cameraBoundaryManager; public CameraBoundaryManager CameraBoundaryManager => cameraBoundaryManager;
public Vector3 CameraTargetPosition => CurrentCameraStreamStack?.TopCameraStream?.VCamera.Follow.position ?? Vector3.zero;
public Vector3 CameraTargetPosition =>
CurrentCameraStreamStack?.TopCameraStream?.VCamera.Follow.position ?? Vector3.zero;
protected override void InitializeVariables() protected override void InitializeVariables()
{ {
@ -41,7 +39,7 @@ namespace Intrepid.Core.Camera
CurrentCameraStreamStack.Enable(); CurrentCameraStreamStack.Enable();
}); });
} }
public bool IsRunningInstance(string id) public bool IsRunningInstance(string id)
{ {
return CurrentCameraStreamStack?.TopCameraStream.Id.Equals(id) ?? false; return CurrentCameraStreamStack?.TopCameraStream.Id.Equals(id) ?? false;
@ -52,44 +50,48 @@ namespace Intrepid.Core.Camera
CurrentCameraStreamStack?.TopCameraStream?.CameraUpdate(CurrentCameraStreamStack?.TopCameraStream); CurrentCameraStreamStack?.TopCameraStream?.CameraUpdate(CurrentCameraStreamStack?.TopCameraStream);
} }
public void ForceFocusOn(Vector3 position) public void ForceFocusOn(Vector2 position)
{ {
if (IsBlendClearing) return; if (IsBlendClearing) return;
StartCoroutine(StraightMoveCameraPosition(position)); StartCoroutine(StraightMoveCameraPosition(position));
} }
private IEnumerator StraightMoveCameraPosition(Vector3 position) private IEnumerator StraightMoveCameraPosition(Vector2 position)
{ {
IsBlendClearing = true; IsBlendClearing = true;
yield return null; yield return null;
CurrentCameraStreamStack?.TopCameraStream.VCamera.gameObject.SetActive(false); CurrentCameraStreamStack?.TopCameraStream.VCamera.gameObject.SetActive(false);
cinemachineBrain.enabled = false; cinemachineBrain.enabled = false;
yield return null; yield return null;
mainCamera.transform.position = position; mainCamera.transform.position = AdaptCameraPosition(position, mainCamera.transform.position);
cinemachineBrain.transform.position = position; cinemachineBrain.transform.position = AdaptCameraPosition(position, mainCamera.transform.position);
if (CurrentCameraStreamStack is not null) if (CurrentCameraStreamStack is not null)
{ {
CurrentCameraStreamStack.TopCameraStream.VCamera.transform.position = position; CurrentCameraStreamStack.TopCameraStream.VCamera.transform.position = AdaptCameraPosition(position, CurrentCameraStreamStack.TopCameraStream.VCamera.transform.position);
} }
CurrentCameraStreamStack?.TopCameraStream.VCamera.gameObject.SetActive(true); CurrentCameraStreamStack?.TopCameraStream.VCamera.gameObject.SetActive(true);
cinemachineBrain.enabled = true; cinemachineBrain.enabled = true;
yield return null; yield return null;
IsBlendClearing = false; IsBlendClearing = false;
} }
private static Vector3 AdaptCameraPosition(Vector2 position, Vector3 oldPosition)
{
return new Vector3(position.x, position.y, oldPosition.z);
}
public Vector2 ScreenToWorldPoint(Vector2 screenPoint) public Vector2 ScreenToWorldPoint(Vector2 screenPoint)
{ {
return mainCamera.ScreenToWorldPoint(screenPoint); return mainCamera.ScreenToWorldPoint(screenPoint);
} }
public Vector2 ScreenToViewportPoint(Vector2 screenPoint) public Vector2 ScreenToViewportPoint(Vector2 screenPoint)
{ {
return mainCamera.ScreenToViewportPoint(screenPoint); return mainCamera.ScreenToViewportPoint(screenPoint);

View File

@ -9,6 +9,7 @@ namespace Intrepid.Core.Camera
{ {
public sealed class CameraZoomManager : EventListener public sealed class CameraZoomManager : EventListener
{ {
[GroupConfigurations, SerializeField] private float startOrthographicSize = 12f;
[GroupConfigurations, SerializeField] private float startZoomSmoothTime = 1f; [GroupConfigurations, SerializeField] private float startZoomSmoothTime = 1f;
[GroupConfigurations, SerializeField] private float defaultOrthographicSize = 7f; [GroupConfigurations, SerializeField] private float defaultOrthographicSize = 7f;
@ -29,16 +30,25 @@ namespace Intrepid.Core.Camera
protected override void OnBootstrap() protected override void OnBootstrap()
{ {
// var stack = CameraSystem.Instance.CurrentCameraStreamStack;
// if (stack.IsNotNull())
// {
// var lens = stack.TopCameraStream.VCamera.Lens;
// lens.OrthographicSize = startOrthographicSize;
// stack.TopCameraStream.VCamera.Lens = lens;
// }
} }
protected override void Subscriptions() protected override void Subscriptions()
{ {
Subscribe<CameraZoomEvent>(e => Subscribe<CameraZoomEvent>(OnCameraZoomEvent);
{
SetZoomLevel(e.ZoomLevel, e.ZoomVelocity);
});
} }
private void OnCameraZoomEvent(CameraZoomEvent e)
{
SetZoomLevel(e.ZoomLevel, e.ZoomVelocity);
}
[GroupDebug, Button(ButtonSizes.Medium, ButtonStyle.FoldoutButton)] [GroupDebug, Button(ButtonSizes.Medium, ButtonStyle.FoldoutButton)]
private void ZoomNone(float zoomSmoothTime = .25f) private void ZoomNone(float zoomSmoothTime = .25f)
{ {

View File

@ -69,7 +69,7 @@ namespace Intrepid.Core.Entities
return !ShouldBeTriggered(entities, physicsTags); return !ShouldBeTriggered(entities, physicsTags);
} }
public abstract void DeployEntity(Vector3 position); public abstract void DeployEntity(Vector2 position);
public abstract void RetreatEntity(); public abstract void RetreatEntity();
} }
} }

View File

@ -24,16 +24,31 @@ namespace Intrepid.Core.Entities
private float fadeDuration; private float fadeDuration;
private float fadeElapsed; private float fadeElapsed;
public bool IsCurrent(AnimationClip clip)
{
return clip.IsNotNull()
&& CurrentClip == clip
&& currentPlayable.IsValid();
}
private float currentSpeed = 1f; public bool IsFadingTo(AnimationClip clip)
private float nextSpeed = 1f; {
return clip.IsNotNull()
&& IsFading
&& nextClip == clip
&& nextPlayable.IsValid();
}
public bool IsPlaying(AnimationClip clip)
{
return IsCurrent(clip) || IsFadingTo(clip);
}
public AnimationClip CurrentClip { get; private set; } public AnimationClip CurrentClip { get; private set; }
public bool IsFading { get; private set; } public bool IsFading { get; private set; }
public bool IsPaused { get; private set; }
public bool IsValid => currentPlayable.IsValid(); public bool IsValid => currentPlayable.IsValid();
public float Time public float Time
@ -76,8 +91,8 @@ namespace Intrepid.Core.Entities
return currentPlayable.IsDone(); return currentPlayable.IsDone();
} }
} }
// Takes looping into consideration. // Take consideration Looping
public bool IsFinished public bool IsFinished
{ {
get get
@ -112,17 +127,66 @@ namespace Intrepid.Core.Entities
graph.Play(); graph.Play();
} }
private void Update() public void Play(AnimationClip clip, float speed = 1f)
{ {
if (IsPaused) if (clip is null) return;
ClearInput(0);
ClearInput(1);
currentInput = 0;
nextInput = 1;
CurrentClip = clip;
nextClip = null;
currentPlayable = AnimationClipPlayable.Create(graph, clip);
currentPlayable.SetTime(0);
currentPlayable.SetSpeed(speed);
graph.Connect(currentPlayable, 0, mixer, currentInput);
mixer.SetInputWeight(currentInput, 1f);
mixer.SetInputWeight(nextInput, 0f);
IsFading = false;
}
public void CrossFade(AnimationClip clip, float fadeDuration, float speed = 1f)
{
if (clip is null) return;
if (!currentPlayable.IsValid() || CurrentClip is null || fadeDuration <= 0f)
{
Play(clip, speed);
return;
}
if (CurrentClip == clip && !IsFading)
{ {
return; return;
} }
if (!IsFading) ClearInput(nextInput);
{
return; nextClip = clip;
}
nextPlayable = AnimationClipPlayable.Create(graph, clip);
nextPlayable.SetTime(0);
nextPlayable.SetSpeed(speed);
graph.Connect(nextPlayable, 0, mixer, nextInput);
mixer.SetInputWeight(nextInput, 0f);
this.fadeDuration = Mathf.Max(0.0001f, fadeDuration);
fadeElapsed = 0f;
IsFading = true;
}
private void Update()
{
if (!IsFading) return;
fadeElapsed += UnityEngine.Time.deltaTime; fadeElapsed += UnityEngine.Time.deltaTime;
@ -137,147 +201,22 @@ namespace Intrepid.Core.Entities
} }
} }
public bool IsCurrent(AnimationClip clip) private void CompleteFade()
{ {
return clip.IsNotNull() ClearInput(currentInput);
&& CurrentClip == clip
&& currentPlayable.IsValid();
}
public bool IsFadingTo(AnimationClip clip) currentPlayable = nextPlayable;
{ CurrentClip = nextClip;
return clip.IsNotNull()
&& IsFading
&& nextClip == clip
&& nextPlayable.IsValid();
}
public bool IsPlaying(AnimationClip clip) nextPlayable = default;
{
return IsCurrent(clip) || IsFadingTo(clip);
}
public void Play(AnimationClip clip, float speed = 1f)
{
if (clip is null)
{
return;
}
IsPaused = false;
ClearInput(0);
ClearInput(1);
currentInput = 0;
nextInput = 1;
CurrentClip = clip;
nextClip = null; nextClip = null;
currentSpeed = speed; mixer.SetInputWeight(currentInput, 0f);
nextSpeed = 1f; mixer.SetInputWeight(nextInput, 1f);
currentPlayable = AnimationClipPlayable.Create(graph, clip); (currentInput, nextInput) = (nextInput, currentInput);
currentPlayable.SetTime(0);
currentPlayable.SetSpeed(currentSpeed);
graph.Connect(currentPlayable, 0, mixer, currentInput);
mixer.SetInputWeight(currentInput, 1f);
mixer.SetInputWeight(nextInput, 0f);
IsFading = false; IsFading = false;
fadeElapsed = 0f;
}
public void CrossFade(AnimationClip clip, float fadeDuration, float speed = 1f)
{
if (clip is null)
{
return;
}
if (!currentPlayable.IsValid() || CurrentClip is null || fadeDuration <= 0f)
{
Play(clip, speed);
return;
}
if (CurrentClip == clip && !IsFading)
{
return;
}
IsPaused = false;
if (currentPlayable.IsValid())
{
currentPlayable.SetSpeed(currentSpeed);
}
if (nextPlayable.IsValid())
{
nextPlayable.SetSpeed(nextSpeed);
}
ClearInput(nextInput);
nextClip = clip;
nextSpeed = speed;
nextPlayable = AnimationClipPlayable.Create(graph, clip);
nextPlayable.SetTime(0);
nextPlayable.SetSpeed(nextSpeed);
graph.Connect(nextPlayable, 0, mixer, nextInput);
mixer.SetInputWeight(nextInput, 0f);
this.fadeDuration = Mathf.Max(0.0001f, fadeDuration);
fadeElapsed = 0f;
IsFading = true;
}
public void Pause()
{
if (IsPaused)
{
return;
}
IsPaused = true;
if (currentPlayable.IsValid())
{
currentPlayable.SetSpeed(0f);
}
if (nextPlayable.IsValid())
{
nextPlayable.SetSpeed(0f);
}
}
public void Unpause()
{
if (!IsPaused)
{
return;
}
IsPaused = false;
if (currentPlayable.IsValid())
{
currentPlayable.SetSpeed(currentSpeed);
}
if (nextPlayable.IsValid())
{
nextPlayable.SetSpeed(nextSpeed);
}
} }
public void Stop() public void Stop()
@ -291,47 +230,11 @@ namespace Intrepid.Core.Entities
CurrentClip = null; CurrentClip = null;
nextClip = null; nextClip = null;
currentInput = 0;
nextInput = 1;
currentSpeed = 1f;
nextSpeed = 1f;
fadeDuration = 0f;
fadeElapsed = 0f;
IsFading = false;
IsPaused = false;
}
private void CompleteFade()
{
ClearInput(currentInput);
currentPlayable = nextPlayable;
CurrentClip = nextClip;
currentSpeed = nextSpeed;
nextPlayable = default;
nextClip = null;
nextSpeed = 1f;
mixer.SetInputWeight(currentInput, 0f);
mixer.SetInputWeight(nextInput, 1f);
(currentInput, nextInput) = (nextInput, currentInput);
fadeElapsed = 0f;
IsFading = false; IsFading = false;
} }
private void ClearInput(int input) private void ClearInput(int input)
{ {
if (!mixer.IsValid())
{
return;
}
var playable = mixer.GetInput(input); var playable = mixer.GetInput(input);
if (playable.IsValid()) if (playable.IsValid())

View File

@ -1,15 +1,11 @@
using System; using System;
using System.Linq; using System.Linq;
using Intrepid.Core.Camera;
using Intrepid.Core.Entities; using Intrepid.Core.Entities;
using Intrepid.Core.Entities.Messages; using Intrepid.Core.Entities.Messages;
using Intrepid.Core.TimeControl; using Intrepid.Core.TimeControl;
using Intrepid.GameManagers;
using Intrepid.Gameplay.Entities.Player.ActionBelt; using Intrepid.Gameplay.Entities.Player.ActionBelt;
using Intrepid.Gameplay.Entities.Player.Sentinel.Cadence; using Intrepid.Gameplay.Entities.Player.Sentinel.Cadence;
using Intrepid.Gameplay.Entities.Player.Sentinel.StateMachine; using Intrepid.Gameplay.Entities.Player.Sentinel.StateMachine;
using Intrepid.Gameplay.Flooring.Events;
using Intrepid.Gameplay.Journey.Messages.Events;
using Intrepid.Structures; using Intrepid.Structures;
using Intrepid.Utilities; using Intrepid.Utilities;
using UnityEngine; using UnityEngine;
@ -35,7 +31,6 @@ namespace Intrepid.Gameplay.Entities.Player.Sentinel
public ActionBeltManager ActionBeltManager => actionBeltManager; public ActionBeltManager ActionBeltManager => actionBeltManager;
public Cadences Cadences => cadences; public Cadences Cadences => cadences;
public static bool IsCoreStable => !CoreStabilityService.Instance.IsCollapsed; public static bool IsCoreStable => !CoreStabilityService.Instance.IsCollapsed;
public bool IsEnabled { get; private set; }
protected override void InitializeVariables() protected override void InitializeVariables()
{ {
@ -49,7 +44,7 @@ namespace Intrepid.Gameplay.Entities.Player.Sentinel
protected override void OnBootstrap() protected override void OnBootstrap()
{ {
StateMachine.StartMachine(); StateMachine.StartMachine();
IsEnabled = false; ResetBrain();
} }
protected override void Subscriptions() protected override void Subscriptions()
@ -65,29 +60,14 @@ namespace Intrepid.Gameplay.Entities.Player.Sentinel
if (CurrentState == SentinelStateType.Fall) return; if (CurrentState == SentinelStateType.Fall) return;
StateMachine.ChangeState(SentinelStateType.Fall); StateMachine.ChangeState(SentinelStateType.Fall);
}); });
Subscribe<ChangeStageStartEvent>(e => }
{
Entity.RetreatEntity(); public void ResetBrain()
IsEnabled = false; {
ChangeState(SentinelStateType.Nop);
});
Subscribe<StageDispatchDeploymentPointEvent>(e =>
{
Entity.DeployEntity(e.DeploymentPoint);
CameraSystem.Instance.ForceFocusOn(e.DeploymentPoint);
IsEnabled = true;
Proxy.Instance.EventBus.Raise(new EmitFloorDetectionEvent
{
FloorDetection = Entity.FloorDetection
});
ChangeState(SentinelStateType.Idle);
});
} }
public override void UpdateFromUpdatable() public override void UpdateFromUpdatable()
{ {
if (!IsEnabled) return;
StateMachine.UpdateStateMachine(); StateMachine.UpdateStateMachine();
InputResolver.Sentinel.CaptureAndPrune(TimeSimulation.Instance.ScaledElapsedTime); InputResolver.Sentinel.CaptureAndPrune(TimeSimulation.Instance.ScaledElapsedTime);
@ -114,15 +94,11 @@ namespace Intrepid.Gameplay.Entities.Player.Sentinel
public override void LateUpdateFromUpdatable() public override void LateUpdateFromUpdatable()
{ {
if (!IsEnabled) return;
StateMachine.CurrentImplementation.RunOnLateUpdate(); StateMachine.CurrentImplementation.RunOnLateUpdate();
} }
public override void FixedUpdateFromUpdatable() public override void FixedUpdateFromUpdatable()
{ {
if (!IsEnabled) return;
StateMachine.CurrentImplementation.RunOnFixedUpdate(); StateMachine.CurrentImplementation.RunOnFixedUpdate();
} }

View File

@ -1,7 +1,6 @@
using Intrepid.Core.Entities; using Intrepid.Core.Entities;
using Intrepid.Core.Grounding; using Intrepid.Core.Grounding;
using Intrepid.GameManagers; using Intrepid.GameManagers;
using Intrepid.Gameplay.Flooring;
using Intrepid.Gameplay.Messages.Events; using Intrepid.Gameplay.Messages.Events;
using Intrepid.Utilities; using Intrepid.Utilities;
using UnityEngine; using UnityEngine;
@ -11,10 +10,8 @@ namespace Intrepid.Gameplay.Entities.Player.Sentinel
public class SentinelEntity : Entity public class SentinelEntity : Entity
{ {
[GroupInjections, SerializeField] private Rigidbody unityRigidbody; [GroupInjections, SerializeField] private Rigidbody unityRigidbody;
[GroupInjections, SerializeField] private CapsuleCollider capsuleCollider;
[GroupInjections, SerializeField] private Transform modelTransform; [GroupInjections, SerializeField] private Transform modelTransform;
[GroupInjections, SerializeField] private EntityModelAnimation modelAnimation; [GroupInjections, SerializeField] private EntityModelAnimation modelAnimation;
[GroupInjections, SerializeField] private FloorDetection floorDetection;
[GroupInjections, SerializeField] private EntityMotorSmoothRotation motorSmoothRotation; [GroupInjections, SerializeField] private EntityMotorSmoothRotation motorSmoothRotation;
[GroupInjections, SerializeField] private EntityMotorPhysicsContact motorPhysicsContact; [GroupInjections, SerializeField] private EntityMotorPhysicsContact motorPhysicsContact;
[GroupInjections, SerializeField] private EntityMotorTopDown motorTopDown; [GroupInjections, SerializeField] private EntityMotorTopDown motorTopDown;
@ -24,7 +21,6 @@ namespace Intrepid.Gameplay.Entities.Player.Sentinel
protected SentinelBrain Brain => EntityBrain as SentinelBrain; protected SentinelBrain Brain => EntityBrain as SentinelBrain;
private Rigidbody UnityRigidbody => unityRigidbody; private Rigidbody UnityRigidbody => unityRigidbody;
private CapsuleCollider CapsuleCollider => capsuleCollider;
// private EntityMotorSmoothRotation MotorSmoothRotation => motorSmoothRotation; // private EntityMotorSmoothRotation MotorSmoothRotation => motorSmoothRotation;
private EntityMotorPhysicsContact MotorPhysicsContact => motorPhysicsContact; private EntityMotorPhysicsContact MotorPhysicsContact => motorPhysicsContact;
private EntityMotorTopDown MotorTopDown => motorTopDown; private EntityMotorTopDown MotorTopDown => motorTopDown;
@ -36,26 +32,15 @@ namespace Intrepid.Gameplay.Entities.Player.Sentinel
public Vector2 Forward => new Vector2(_desiredForward.x, _desiredForward.z).normalized; public Vector2 Forward => new Vector2(_desiredForward.x, _desiredForward.z).normalized;
public bool IsGrounded => MotorTopDown.IsGrounded; public bool IsGrounded => MotorTopDown.IsGrounded;
public GroundProfiles CurrentGroundProfiles => MotorTopDown.CurrentGroundProfiles; public GroundProfiles CurrentGroundProfiles => MotorTopDown.CurrentGroundProfiles;
public FloorDetection FloorDetection => floorDetection;
public override void DeployEntity(Vector3 position) public override void DeployEntity(Vector2 position)
{ {
UnityRigidbody.position = position; Brain.ResetBrain();
UnityRigidbody.isKinematic = false;
CapsuleCollider.enabled = true;
MotorTopDown.enabled = true;
MotorPhysicsContact.enabled = true;
RefreshMovementNormal(); RefreshMovementNormal();
} }
public override void RetreatEntity() public override void RetreatEntity()
{ {
UnityRigidbody.isKinematic = true;
CapsuleCollider.enabled = false;
MotorTopDown.enabled = false;
MotorPhysicsContact.enabled = false;
} }
public void ChangeOrientation(Vector2 direction) public void ChangeOrientation(Vector2 direction)
@ -73,8 +58,6 @@ namespace Intrepid.Gameplay.Entities.Player.Sentinel
public override void UpdateFromUpdatable() public override void UpdateFromUpdatable()
{ {
if (!Brain.IsEnabled) return;
modelTransform.rotation = Quaternion.LookRotation(_desiredForward, Vector3.up); modelTransform.rotation = Quaternion.LookRotation(_desiredForward, Vector3.up);
//MotorSmoothRotation.TurnModel(modelTransform, _desiredForward); //MotorSmoothRotation.TurnModel(modelTransform, _desiredForward);
base.UpdateFromUpdatable(); base.UpdateFromUpdatable();
@ -82,8 +65,6 @@ namespace Intrepid.Gameplay.Entities.Player.Sentinel
public override void FixedUpdateFromUpdatable() public override void FixedUpdateFromUpdatable()
{ {
if (!Brain.IsEnabled) return;
base.FixedUpdateFromUpdatable(); base.FixedUpdateFromUpdatable();
_intendedDesiredVelocity = new Vector3(DesiredVelocity.x, 0, DesiredVelocity.y); _intendedDesiredVelocity = new Vector3(DesiredVelocity.x, 0, DesiredVelocity.y);
LinearVelocity = MotorPhysicsContact.AdjustVelocityByContacts(DesiredVelocity); LinearVelocity = MotorPhysicsContact.AdjustVelocityByContacts(DesiredVelocity);
@ -96,16 +77,12 @@ namespace Intrepid.Gameplay.Entities.Player.Sentinel
private void OnCollisionEnter(Collision collision) private void OnCollisionEnter(Collision collision)
{ {
if (!Brain.IsEnabled) return;
MotorPhysicsContact.RegisterCollisionContacts(collision, MotorTopDown.MaxSlopeAngle); MotorPhysicsContact.RegisterCollisionContacts(collision, MotorTopDown.MaxSlopeAngle);
TryRaiseImpact(LinearVelocity); TryRaiseImpact(LinearVelocity);
} }
private void OnCollisionStay(Collision collision) private void OnCollisionStay(Collision collision)
{ {
if (!Brain.IsEnabled) return;
MotorPhysicsContact.RegisterCollisionContacts(collision, MotorTopDown.MaxSlopeAngle); MotorPhysicsContact.RegisterCollisionContacts(collision, MotorTopDown.MaxSlopeAngle);
TryRaiseImpact(_intendedDesiredVelocity); TryRaiseImpact(_intendedDesiredVelocity);
} }

View File

@ -2,8 +2,7 @@ namespace Intrepid.Gameplay.Entities.Player.Sentinel
{ {
public enum SentinelStateType public enum SentinelStateType
{ {
Nop = 0, None = 0,
PDA = 1, PDA = 1,
Idle = 10, Idle = 10,

View File

@ -1,31 +0,0 @@
using Intrepid.Structures;
using UnityEngine;
namespace Intrepid.Gameplay.Entities.Player.Sentinel.StateMachine.States
{
public class SentinelStateNop : SentinelState
{
public override SentinelStateType GetStateKey()
{
return SentinelStateType.Nop;
}
protected override void Subscriptions()
{
}
protected override void RunOnEnter(ParameterStore ps)
{
Brain.Entity.ModelAnimation.Pause();
Brain.Entity.DesiredVelocity = Vector2.zero;
}
protected override void RunOnExit()
{
}
public override void RunOnUpdate()
{
}
}
}

View File

@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: f244623cb1824165863f6e8188bf6256
timeCreated: 1782145081

View File

@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: 01c2d3509e324acda2c81bfd5e02a51c
timeCreated: 1782138594

View File

@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: fe589b126c0b4221855565880d361022
timeCreated: 1782138616

View File

@ -1,9 +0,0 @@
using Intrepid.SimpleEvents;
namespace Intrepid.Gameplay.Flooring.Events
{
public class EmitFloorDetectionEvent : IEventBase
{
public FloorDetection FloorDetection { get; set; }
}
}

View File

@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: a46794442c784ad383b0df8760873039
timeCreated: 1782138639

View File

@ -1,6 +1,6 @@
using Intrepid.SimpleEvents; using Intrepid.SimpleEvents;
namespace Intrepid.Gameplay.Journey.Messages.Events namespace Intrepid.Gameplay.Journey.Events
{ {
public class ChangeStageStartEvent : IEventBase public class ChangeStageStartEvent : IEventBase
{ {

View File

@ -1,11 +1,7 @@
using System; using System;
using System.Collections; using System.Collections;
using Intrepid.Core.Camera;
using Intrepid.Diagnostics; using Intrepid.Diagnostics;
using Intrepid.GameManagers; using Intrepid.GameManagers;
using Intrepid.Gameplay.Journey.Messages;
using Intrepid.Gameplay.Journey.Messages.Events;
using Intrepid.Integration.Input;
using Intrepid.SimpleEvents; using Intrepid.SimpleEvents;
using Intrepid.Theatre.BackStage; using Intrepid.Theatre.BackStage;
using Intrepid.Theatre.Curtain; using Intrepid.Theatre.Curtain;
@ -15,39 +11,29 @@ using UnityEngine;
namespace Intrepid.Gameplay.Journey namespace Intrepid.Gameplay.Journey
{ {
public class JourneyManager : SingletonEventListener<JourneyManager>, IBackStageProcessor public class JourneyManager : SingletonEventListener<JourneyManager>
{ {
private const string Id = "JourneyManager";
[GroupConfigurations, SerializeField] private CurtainTypeTag curtainType; [GroupConfigurations, SerializeField] private CurtainTypeTag curtainType;
[GroupInjections, SerializeField] private JourneyService journeyService; [GroupInjections, SerializeField] private JourneyService journeyService;
[GroupInjections, SerializeField] private BackStageService backStageService; [GroupInjections, SerializeField] private BackStageService backStageService;
#if UNITY_EDITOR #if UNITY_EDITOR
[GroupDebug, SerializeField, ToggleLeft] private bool isRunningTest; [GroupDebug, SerializeField, ToggleLeft] private bool isRunningTest;
[GroupDebug, SerializeField, ShowIf("IsRunningTest")] private StageTag stageToTest; [GroupDebug, SerializeField, ShowIf("IsRunningTest")] private StageTag stageToTest;
[GroupDebug, SerializeField, ShowIf("IsRunningTest")] private Transform landingStart;
#endif #endif
private StageStateMachine StageStateMachine { get; } = new();
private CurtainTypeTag CurtainType => curtainType;
private BackStageService BackStageService => backStageService;
private JourneyService JourneyService => journeyService;
#if UNITY_EDITOR #if UNITY_EDITOR
private bool IsRunningTest => isRunningTest; private bool IsRunningTest => isRunningTest;
#endif #endif
private StageTag StageToChange { get; set; } private JourneyService JourneyService => journeyService;
private IBackStageWindowExecution CallbackProcessors { get; set; } private StageStateMachine StageStateMachine { get; } = new();
private string DestinyEndpoint { get; set; } private StageTag StageToStartJourney { get; set; }
private InputSchema LastInputSchema { get; set; } = InputSchema.None;
public bool IsProcessFinished => StageStateMachine.IsLoadingFinished && !CameraSystem.Instance.IsCameraBlending;
protected override void InitializeVariables() protected override void InitializeVariables()
{ {
SingletonInstantiation(false, manager => SingletonInstantiation(false, manager =>
{ {
var stageTags = manager.JourneyService.Initialize(); var stageTags = manager.JourneyService.Initialize();
manager.StageStateMachine.LoadMachine(stageTags); manager.StageStateMachine.LoadMachine(stageTags, curtainType, backStageService);
}); });
} }
@ -56,8 +42,14 @@ namespace Intrepid.Gameplay.Journey
#if UNITY_EDITOR #if UNITY_EDITOR
if (IsRunningTest && stageToTest.IsNotNull()) if (IsRunningTest && stageToTest.IsNotNull())
{ {
LoadJourneyForTesting(stageToTest, landingStart); JourneyStartForTesting(stageToTest);
} }
else
{
JourneyStart();
}
#else
JourneyStart();
#endif #endif
} }
@ -67,61 +59,51 @@ namespace Intrepid.Gameplay.Journey
private void Update() private void Update()
{ {
BackStageService.UpdateCurtains(); StageStateMachine.UpdateCurtains();
} }
protected override void OnTearDown() protected override void OnTearDown()
{ {
StageStateMachine.TearDown(); StageStateMachine.TearDown();
} }
private void LoadJourney(LoadJourneyRequest request) public void LoadStageToStart(StageTag stage) // we are going to add more data here
{ {
if (request is null) if (stage.IsNull())
{ {
DLogger.LogError("load journey request should not be null"); throw new NullReferenceException("we should initialize a stage to start journey first!");
return;
}
if (request.StageTag.IsNull() || string.IsNullOrWhiteSpace(request.StageTag.Code))
{
DLogger.LogError("stage tag/code should not be null or empty");
return;
} }
StageStateMachine.InitMachine(request.StageTag); StageToStartJourney = stage;
}
[GroupDebug, Button(ButtonSizes.Large, ButtonStyle.FoldoutButton)]
private void LoadJourneyForTesting(StageTag stage, Transform landing)
{
LoadJourney(new LoadJourneyRequest
{
StageTag = stage
});
StartCoroutine(OpenAfterNSecs(landing));
}
private IEnumerator OpenAfterNSecs(Transform landing, float nSecs = 1f)
{
yield return new WaitForSeconds(nSecs);
Proxy.Instance.EventBus.Raise(new StageDispatchDeploymentPointEvent
{
DeploymentPoint = landing.position,
});
Proxy.Instance.CurtainStateMachine.RaiseCommand(CurtainCommandType.Open);
InputService.Instance.ChangeInputSchema(InputSchema.Sentinel);
}
[GroupDebug, Button(ButtonSizes.Large, ButtonStyle.FoldoutButton)]
private void ChangeStageForTesting(StageTag stageTag, string destinyEndpoint)
{
ChangeStageTo(stageTag, destinyEndpoint);
} }
public void ChangeStageTo( public void JourneyStart(StageTag stage = null)
StageTag stageTag, {
string destinyEndpoint, if (stage is not null)
IBackStageWindowExecution callbacks = null) {
StageToStartJourney = stage;
}
if (StageToStartJourney is null)
{
throw new NullReferenceException("we should initialize a stage to start journey first!");
}
StageStateMachine.InitMachine(StageToStartJourney);
}
[GroupDebug, Button(ButtonSizes.Large, ButtonStyle.FoldoutButton)]
private void JourneyStartForTesting(StageTag stage)
{
JourneyStart(stage);
StartCoroutine(OpenAfter2Secs());
}
private static IEnumerator OpenAfter2Secs()
{
yield return new WaitForSeconds(2f);
Proxy.Instance.CurtainStateMachine.RaiseCommand(CurtainCommandType.Open);
}
public void ChangeStageTo(StageTag stage, IBackStageWindowExecution callbacks = null)
{ {
#if UNITY_EDITOR #if UNITY_EDITOR
if (IsRunningTest) if (IsRunningTest)
@ -130,49 +112,7 @@ namespace Intrepid.Gameplay.Journey
return; return;
} }
#endif #endif
if (stageTag.IsNull() || string.IsNullOrEmpty(stageTag.Code)) StageStateMachine.ChangeTo(stage, callbacks);
{
throw new ArgumentException("stage tag cannot be null or empty");
}
if (StageStateMachine.CurrentStageTag == stageTag) return;
DestinyEndpoint = destinyEndpoint;
if (BackStageService.KickProcess(CurtainType, Id, this))
{
StageToChange = stageTag;
}
CallbackProcessors = callbacks;
}
public void AfterOpened()
{
DestinyEndpoint = null;
CallbackProcessors?.AfterOpened();
Proxy.Instance.EventBus.Raise(new ChangeStageEndEvent());
InputService.Instance.ChangeInputSchema(LastInputSchema);
LastInputSchema = InputSchema.None;
}
public void BeforeOpening()
{
CallbackProcessors?.BeforeOpening();
Proxy.Instance.EventBus.Raise(new ChangeStageLandingOnStageStepEvent
{
DestinyEndpoint = DestinyEndpoint
});
}
public void AfterClosed()
{
Proxy.Instance.EventBus.Raise(new ChangeStageStartEvent());
StageStateMachine.ChangeState(StageToChange);
CallbackProcessors?.AfterClosed();
}
public void BeforeClosing()
{
LastInputSchema = InputService.Instance.CurrentInputSchema;
InputService.Instance.ChangeInputSchema(InputSchema.None);
CallbackProcessors?.BeforeClosing();
} }
} }
} }

View File

@ -1,5 +1,6 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using Intrepid.Diagnostics; using Intrepid.Diagnostics;
using Intrepid.Utilities; using Intrepid.Utilities;
using Sirenix.OdinInspector; using Sirenix.OdinInspector;
@ -14,43 +15,25 @@ namespace Intrepid.Gameplay.Journey
[CreateAssetMenu(fileName = "Journey Service", menuName = "GON/Services/Journey Service")] [CreateAssetMenu(fileName = "Journey Service", menuName = "GON/Services/Journey Service")]
public class JourneyService : ScriptableObject public class JourneyService : ScriptableObject
{ {
[GroupInjections, SerializeField] [GroupInjections, SerializeField] private JGraphSO journeyGraph;
private JGraphSO journeyGraph;
[GroupInjections, SerializeField, ReadOnly, ListDrawerSettings(ShowFoldout = false)] [GroupInjections, SerializeField, ReadOnly, ListDrawerSettings(ShowFoldout = false)]
private List<StageTag> stagesTags = new(); private List<StageTag> stagesTags;
private Dictionary<StageTag, JStage> StageMap { get; } = new(); private Dictionary<StageTag, JStage> StageMap { get; } = new();
private Dictionary<string, StageTag> StageTagMap { get; } = new();
private Dictionary<string, JEndpoint> EndpointMap { get; } = new();
private Dictionary<string, StageTag> EndpointStageTagMap { get; } = new();
private Dictionary<string, Dictionary<string, List<JConnection>>> StageConnections { get; } = new();
#if UNITY_EDITOR #if UNITY_EDITOR
[PropertyOrder(-10)] [PropertyOrder(-10)]
[GroupInjections, Button(ButtonSizes.Large), GUIColor(0.35f, 0.8f, .35f)] [GroupInjections, Button(ButtonSizes.Large), GUIColor(0.35f, 0.8f, .35f)]
protected void FindAllStageTags() protected void FindAllStageTags()
{ {
stagesTags ??= new();
stagesTags.Clear(); stagesTags.Clear();
var guids = AssetDatabase.FindAssets($"t:StageTag");
var guids = AssetDatabase.FindAssets("t:StageTag");
foreach (var guid in guids) foreach (var guid in guids)
{ {
var path = AssetDatabase.GUIDToAssetPath(guid); var path = AssetDatabase.GUIDToAssetPath(guid);
var stageTag = AssetDatabase.LoadAssetAtPath<StageTag>(path); var stage = AssetDatabase.LoadAssetAtPath<StageTag>(path);
stagesTags.Add(stage);
if (stageTag.IsNull())
{
continue;
}
stagesTags.Add(stageTag);
} }
EditorUtility.SetDirty(this); EditorUtility.SetDirty(this);
@ -72,20 +55,19 @@ namespace Intrepid.Gameplay.Journey
return; return;
} }
var stageTagMap = BuildStageTagMap(); // check if every stage in the graph has a stage tag associated.
var map = stagesTags.ToDictionary(stageTag => stageTag.StageId);
foreach (var jStage in journeyGraph.stages) foreach (var jStage in journeyGraph.stages)
{ {
if (!stageTagMap.TryGetValue(jStage.id, out var tag)) if (!map.TryGetValue(jStage.id, out var tag))
{ {
DLogger.LogDebug($"Stage {jStage.id} is not found in the stage tag list"); DLogger.LogDebug($"Stage {jStage.id} is not found in the stage tag list");
continue; continue;
} }
tag.TestIfExists(); tag.TestIfExists();
} }
} }
public Dictionary<string, StageTag>.ValueCollection Initialize() public Dictionary<string, StageTag>.ValueCollection Initialize()
{ {
if (journeyGraph.IsNull()) if (journeyGraph.IsNull())
@ -93,186 +75,20 @@ namespace Intrepid.Gameplay.Journey
throw new NullReferenceException($"{nameof(journeyGraph)} should not be null or empty"); throw new NullReferenceException($"{nameof(journeyGraph)} should not be null or empty");
} }
ClearRuntimeCache(); var map = stagesTags.ToDictionary(stageTag => stageTag.StageId);
BuildStageTagCache();
BuildEndpointCache();
BuildStageConnectionCache();
BuildStageMapCache();
return StageTagMap.Values;
}
private void ClearRuntimeCache()
{
StageMap.Clear();
StageTagMap.Clear();
EndpointMap.Clear();
EndpointStageTagMap.Clear();
StageConnections.Clear();
}
private Dictionary<string, StageTag> BuildStageTagMap()
{
var map = new Dictionary<string, StageTag>();
if (stagesTags.IsNull())
{
return map;
}
foreach (var stageTag in stagesTags)
{
if (stageTag.IsNull())
{
continue;
}
if (string.IsNullOrWhiteSpace(stageTag.StageId))
{
DLogger.LogWarn($"StageTag {stageTag.name} has null or empty StageId");
continue;
}
if (!map.TryAdd(stageTag.StageId, stageTag))
{
DLogger.LogWarn($"Duplicated StageTag for StageId {stageTag.StageId}");
}
}
return map;
}
private void BuildStageTagCache()
{
var map = BuildStageTagMap();
foreach (var pair in map)
{
StageTagMap.Add(pair.Key, pair.Value);
}
}
private void BuildEndpointCache()
{
foreach (var endpoint in journeyGraph.endpoints)
{
if (endpoint.IsNull())
{
continue;
}
if (string.IsNullOrWhiteSpace(endpoint.id))
{
DLogger.LogWarn("Endpoint with null or empty id found");
continue;
}
if (!EndpointMap.TryAdd(endpoint.id, endpoint))
{
DLogger.LogWarn($"Duplicated endpoint id {endpoint.id}");
continue;
}
EnsureStageConnectionBucket(endpoint.stageId, endpoint.id);
if (StageTagMap.TryGetValue(endpoint.stageId, out var stageTag))
{
EndpointStageTagMap.TryAdd(endpoint.id, stageTag);
}
else
{
DLogger.LogWarn($"Endpoint {endpoint.id} references stage {endpoint.stageId}, but no StageTag was found");
}
}
}
private void BuildStageConnectionCache()
{
foreach (var connection in journeyGraph.connections)
{
if (connection.IsNull())
{
continue;
}
if (!EndpointMap.TryGetValue(connection.endpointAId, out var endpointA))
{
DLogger.LogWarn($"Connection {connection.id} has invalid endpoint A: {connection.endpointAId}");
continue;
}
if (!EndpointMap.TryGetValue(connection.endpointBId, out var endpointB))
{
DLogger.LogWarn($"Connection {connection.id} has invalid endpoint B: {connection.endpointBId}");
continue;
}
StageConnections[endpointA.stageId][endpointA.id].Add(connection);
StageConnections[endpointB.stageId][endpointB.id].Add(connection);
}
}
private void BuildStageMapCache()
{
foreach (var jStage in journeyGraph.stages) foreach (var jStage in journeyGraph.stages)
{ {
if (jStage.IsNull()) if (map.TryGetValue(jStage.id, out var tag))
{ {
continue; StageMap.Add(tag, jStage);
}
if (StageTagMap.TryGetValue(jStage.id, out var tag))
{
StageMap.TryAdd(tag, jStage);
} }
else else
{ {
DLogger.LogWarn($"Stage {jStage.id} is not found in the stage tag list"); DLogger.LogWarn($"Stage {jStage.id} is not found in the stage tag list");
} }
} }
}
private void EnsureStageConnectionBucket(string stageId, string endpointId) return map.Values;
{
if (!StageConnections.TryGetValue(stageId, out var stageConnections))
{
stageConnections = new Dictionary<string, List<JConnection>>();
StageConnections[stageId] = stageConnections;
}
stageConnections.TryAdd(endpointId, new List<JConnection>());
}
public bool TryGetJConnections(
string stageId,
string endpointId,
out IReadOnlyList<JConnection> jConnections)
{
if (StageConnections.TryGetValue(stageId, out var stageConnections) &&
stageConnections.TryGetValue(endpointId, out var connections))
{
jConnections = connections;
return true;
}
jConnections = Array.Empty<JConnection>();
return false;
}
public bool TryGetStageTagFromEndpoint(string endpointId, out StageTag stageTag)
{
return EndpointStageTagMap.TryGetValue(endpointId, out stageTag);
}
public bool TryGetEndpoint(string endpointId, out JEndpoint endpoint)
{
return EndpointMap.TryGetValue(endpointId, out endpoint);
}
public bool TryGetJStage(StageTag stageTag, out JStage jStage)
{
return StageMap.TryGetValue(stageTag, out jStage);
} }
} }
} }

View File

@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: d0b00b38e81042458fedcd6bca42c1da
timeCreated: 1782140838

View File

@ -1,9 +0,0 @@
using Intrepid.SimpleEvents;
namespace Intrepid.Gameplay.Journey.Messages.Events
{
public class ChangeStageEndEvent : IEventBase
{
}
}

View File

@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: 497764573be84dfa892dfc6531b6a750
timeCreated: 1782139580

View File

@ -1,9 +0,0 @@
using Intrepid.SimpleEvents;
namespace Intrepid.Gameplay.Journey.Messages.Events
{
public class ChangeStageLandingOnStageStepEvent : IEventBase
{
public string DestinyEndpoint { get; set; }
}
}

View File

@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: 0654d29958154e3ba3e3469281fc1861
timeCreated: 1782139865

View File

@ -1,10 +0,0 @@
using Intrepid.SimpleEvents;
using UnityEngine;
namespace Intrepid.Gameplay.Journey.Messages.Events
{
public class StageDispatchDeploymentPointEvent : IEventBase
{
public Vector3 DeploymentPoint { get; set; }
}
}

View File

@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: 8cabff0925674eca97250dff0539083b
timeCreated: 1782153948

View File

@ -1,7 +0,0 @@
namespace Intrepid.Gameplay.Journey.Messages
{
public class LoadJourneyRequest
{
public StageTag StageTag { get; set; }
}
}

View File

@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: baa828e6c92c41dcb89539145a4ffd17
timeCreated: 1782140854

View File

@ -1,25 +1,40 @@
using System;
using System.Collections.Generic; using System.Collections.Generic;
using Intrepid.Core.Camera;
using Intrepid.Diagnostics; using Intrepid.Diagnostics;
using Intrepid.FSM; using Intrepid.FSM;
using Intrepid.GameManagers;
using Intrepid.Gameplay.Journey.Events;
using Intrepid.Integration.Input;
using Intrepid.Theatre.BackStage;
using Intrepid.Theatre.Curtain;
namespace Intrepid.Gameplay.Journey namespace Intrepid.Gameplay.Journey
{ {
public sealed class StageStateMachine public class StageStateMachine : IBackStageProcessor
{ {
private FStateMachine<StageTag, StageLoadingService> StateMachine { get; } = new(); private FStateMachine<StageTag, StageLoadingService> StateMachine { get; } = new();
private IState<StageTag, StageLoadingService> CurrentState => StateMachine.GetCurrentState(); private StageTag StageToChange { get; set; }
private CurtainTypeTag CurtainType { get; set; }
public StageTag CurrentStageTag => CurrentState.GetStateKey(); private BackStageService BackStageService { get; set; }
public bool IsLoadingFinished => CurrentState.Implementation().IsLoadingFinished; private IBackStageWindowExecution BackStageProcessor { get; set; }
public bool IsRunning => StateMachine.IsRunning;
public void LoadMachine(IEnumerable<StageTag> stageTags) public string Id { get; set; }
public StageTag CurrentStage => StateMachine.GetCurrentState().GetStateKey();
public void LoadMachine(
IEnumerable<StageTag> stageTags,
CurtainTypeTag curtainType,
BackStageService backStageService)
{ {
if (StateMachine.IsRunning) if (StateMachine.IsRunning)
{ {
DLogger.LogError("stage state machine is already running (are we changing state outside JourneyManager?"); DLogger.LogError("stage state machine is already running (are we changing state outside JourneyManager?");
return; return;
} }
CurtainType = curtainType;
BackStageService = backStageService;
foreach (var stageTag in stageTags) foreach (var stageTag in stageTags)
{ {
StateMachine.AddState(new StageLoadingService(stageTag)); StateMachine.AddState(new StageLoadingService(stageTag));
@ -32,10 +47,27 @@ namespace Intrepid.Gameplay.Journey
StateMachine.InitializeWith(stageTag); StateMachine.InitializeWith(stageTag);
StateMachine.Start(); StateMachine.Start();
} }
public void ChangeState(StageTag stageTag) public void UpdateCurtains()
{ {
StateMachine.ChangeState(stageTag); BackStageService.UpdateCurtains();
}
public void ChangeTo(
StageTag stageTag,
IBackStageWindowExecution backStageProcessor = null)
{
// if (landingPortal.IsNull() || string.IsNullOrEmpty(landingPortal.Code))
// {
// throw new ArgumentException("landing portal cannot be null or empty");
// }
if (StateMachine.GetCurrentState().GetStateKey() == stageTag) return;
if (BackStageService.KickProcess(CurtainType, Id, this))
{
StageToChange = stageTag;
}
BackStageProcessor = backStageProcessor;
} }
public void TearDown() public void TearDown()
@ -43,5 +75,37 @@ namespace Intrepid.Gameplay.Journey
if (!StateMachine.IsRunning) return; if (!StateMachine.IsRunning) return;
StateMachine.GetCurrentState().OnExitState(); StateMachine.GetCurrentState().OnExitState();
} }
public bool IsProcessFinished => StateMachine.GetCurrentState().Implementation().IsLoadingFinished
&& !CameraSystem.Instance.IsCameraBlending;
public void AfterOpened()
{
BackStageProcessor?.AfterOpened();
InputService.Instance.ChangeInputSchema(InputSchema.Sentinel);
}
public void BeforeOpening()
{
// Proxy.Instance.EventBus.Raise(new ChangeStageLandingOnStageStepEvent
// {
// LandingPortalCode = LastLandingPortalCode,
// });
// LastLandingPortalCode = null;
BackStageProcessor?.BeforeOpening();
}
public void AfterClosed()
{
Proxy.Instance.EventBus.Raise(new ChangeStageStartEvent());
StateMachine.ChangeState(StageToChange);
BackStageProcessor?.AfterClosed();
}
public void BeforeClosing()
{
InputService.Instance.ChangeInputSchema(InputSchema.None);
BackStageProcessor?.BeforeClosing();
}
} }
} }

View File

@ -7,7 +7,7 @@ using UnityEngine;
namespace Intrepid.Gameplay.Journey namespace Intrepid.Gameplay.Journey
{ {
[Serializable] [Serializable]
[CreateAssetMenu(fileName = "Stage Tag", menuName = "GON/Tags/Stage Tag")] [CreateAssetMenu(fileName = "Stage Tag", menuName = "GON/Tag/Stage Tag")]
public class StageTag : SceneTag public class StageTag : SceneTag
{ {
[GroupConfigurations, SerializeField] private string stageId; [GroupConfigurations, SerializeField] private string stageId;

View File

@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: 1f530d09e5cb49ceb525a4ea0b540014
timeCreated: 1782147645

View File

@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: cbd3083bdb524dd3ab68cefba525e3c9
timeCreated: 1782152485

View File

@ -1,36 +0,0 @@
using System;
using Intrepid.Utilities;
using UnityEngine;
namespace Intrepid.Gameplay.Journey.Stages.Sockets
{
public class StageSocket : MonoBehaviour
{
[GroupInjections, SerializeField] private Transform deploymentPoint;
[GroupInjections, SerializeField] private StageSocketChangeTrigger changeTrigger;
[GroupConfigurations, SerializeField] private string endpointId;
public string StageId
{
get => changeTrigger.StageId;
set => changeTrigger.StageId = value;
}
public string EndpointId
{
get => endpointId;
set => endpointId = value;
}
public Vector3 DeploymentPoint => deploymentPoint.position;
private void OnValidate()
{
if (changeTrigger.IsNull()) return;
changeTrigger.EndpointId = endpointId;
}
private void Awake()
{
OnValidate();
}
}
}

View File

@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: 06e19c5ea6de4ba2ba26ba0d99942d16
timeCreated: 1782152501

View File

@ -1,77 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Intrepid.Core.Entities;
using Intrepid.Core.Tags;
using Intrepid.Diagnostics;
using Intrepid.Utilities;
using Sirenix.OdinInspector;
using UnityEngine;
namespace Intrepid.Gameplay.Journey.Stages.Sockets
{
public class StageSocketChangeTrigger : EntityTrigger
{
[GroupInjections, SerializeField] private JourneyService journeyService;
[GroupDebug, SerializeField, ReadOnly] private string stageId;
[GroupDebug, SerializeField, ReadOnly] private string endpointId;
private BoxCollider BoxCollider => MainCollider as BoxCollider;
public string StageId
{
get => stageId;
set => stageId = value;
}
public string EndpointId
{
get => endpointId;
set => endpointId = value;
}
protected override void WhenRaiseEnterEvent(Collider other, EntitySensor entitySensor, List<BehaviourTag> behaviourTags)
{
if (!journeyService.TryGetJConnections(stageId, endpointId, out var jConnections))
{
DLogger.LogWarn($"Stage {stageId} has invalid endpoint: {endpointId}");
return;
}
if (jConnections.Count > 1)
{
DLogger.LogWarn($"Stage {stageId} has multiple connections from endpoint: {endpointId}");
return;
}
var destinyEndpoint = GrabDestinyEndpoint(jConnections.First());
if (!journeyService.TryGetStageTagFromEndpoint(destinyEndpoint, out var stageTag))
{
DLogger.LogWarn($"Stage {stageId} has invalid endpoint: {endpointId}");
return;
}
JourneyManager.Instance.ChangeStageTo(stageTag, destinyEndpoint);
DLogger.LogDebug("stage change");
}
private string GrabDestinyEndpoint(JConnection jConnection)
{
return endpointId.Equals(jConnection.endpointAId, StringComparison.Ordinal)
? jConnection.endpointBId
: jConnection.endpointAId;
}
protected override void WhenRaiseExitEvent(Collider other, EntitySensor entitySensor)
{
}
#if UNITY_EDITOR
private void OnDrawGizmos()
{
if (BoxCollider is null)
{
return;
}
Gizmos.color = Color.red;
Gizmos.DrawWireCube(BoxCollider.bounds.center, BoxCollider.bounds.size);
}
#endif
}
}

View File

@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: 3c11245659b8459cbfa73b4a882f63f8
timeCreated: 1782147660

View File

@ -1,58 +0,0 @@
using System.Collections.Generic;
using Intrepid.Diagnostics;
using Intrepid.GameManagers;
using Intrepid.Gameplay.Journey.Messages.Events;
using Intrepid.Gameplay.Journey.Stages.Sockets;
using Intrepid.SimpleEvents;
using Intrepid.Utilities;
using Sirenix.OdinInspector;
using UnityEngine;
namespace Intrepid.Gameplay.Journey.Stages
{
public class StageManager : EventListener
{
[GroupConfigurations, SerializeField] private string stageId;
[GroupDebug, SerializeField] private List<StageSocket> sockets;
private Dictionary<string, StageSocket> SocketMap { get; } = new();
protected override void InitializeVariables()
{
Refresh();
}
protected override void OnBootstrap()
{
}
protected override void Subscriptions()
{
Subscribe<ChangeStageLandingOnStageStepEvent>(e =>
{
if (SocketMap.TryGetValue(e.DestinyEndpoint, out var stageSocket))
{
Proxy.Instance.EventBus.Raise(new StageDispatchDeploymentPointEvent
{
DeploymentPoint = stageSocket.DeploymentPoint,
});
return;
}
DLogger.LogError($"No stage socket found for endpoint {e.DestinyEndpoint}");
});
}
[GroupDebug, Button(ButtonSizes.Medium)]
private void Refresh()
{
sockets.Clear();
foreach (var stageSocket in GetComponentsInChildren<StageSocket>())
{
stageSocket.StageId = stageId;
sockets.Add(stageSocket);
SocketMap.Add(stageSocket.EndpointId, stageSocket);
}
}
}
}

View File

@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: d328f8f221d44d379a466647b7b12719
timeCreated: 1782153254

View File

@ -2,7 +2,7 @@ using Intrepid.Utilities;
using Sirenix.OdinInspector; using Sirenix.OdinInspector;
using UnityEngine; using UnityEngine;
namespace Intrepid.Gameplay.Flooring namespace Temporary
{ {
public class FloorDetection : MonoBehaviour public class FloorDetection : MonoBehaviour
{ {

View File

@ -1,14 +1,12 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using Intrepid.Gameplay.Flooring.Events;
using Intrepid.SimpleEvents;
using Intrepid.Utilities; using Intrepid.Utilities;
using Sirenix.OdinInspector; using Sirenix.OdinInspector;
using UnityEngine; using UnityEngine;
namespace Intrepid.Gameplay.Flooring namespace Temporary
{ {
public class FloorManager : EventListener public class FloorManager : SingletonMonoBehaviour<FloorManager>
{ {
private const float DisabledUpperThreshold = 1_000_000f; private const float DisabledUpperThreshold = 1_000_000f;
private const float DisabledUpperMax = 1_000_001f; private const float DisabledUpperMax = 1_000_001f;
@ -16,36 +14,31 @@ namespace Intrepid.Gameplay.Flooring
private const float DisabledLowerThreshold = -1_000_000f; private const float DisabledLowerThreshold = -1_000_000f;
private const float DisabledLowerMin = -1_000_001f; private const float DisabledLowerMin = -1_000_001f;
[GroupDebug, SerializeField, ReadOnly] private FloorDetection floorDetection; [GroupInjections, SerializeField] private FloorDetection floorDetection;
[GroupConfigurations("Upper Fade"), SerializeField] private float upperMax = 5.5f; [GroupConfigurations("Upper Fade"), SerializeField] private float upperMax = 5.75f;
[GroupConfigurations("Upper Fade"), SerializeField] private float upperThreshold = 5.2f; [GroupConfigurations("Upper Fade"), SerializeField] private float upperThreshold = 3f;
[GroupConfigurations("Lower Tint"), SerializeField] private float lowerThreshold = -1.5f; [GroupConfigurations("Lower Tint"), SerializeField] private float lowerThreshold = -3f;
[GroupConfigurations("Lower Tint"), SerializeField] private float lowerMin = -9f; [GroupConfigurations("Lower Tint"), SerializeField] private float lowerMin = -6f;
[GroupConfigurations("Lower Tint"), SerializeField] private Color lowerTintColor = new(0.35f, 0.35f, 0.35f, 1f); [GroupConfigurations("Lower Tint"), SerializeField] private Color lowerTintColor = new(0.35f, 0.35f, 0.35f, 1f);
private List<FloorVisualGroup> FloorVisualGroups { get; } = new(); private List<FloorVisualGroup> FloorVisualGroups { get; } = new();
protected override void InitializeVariables() private void Awake()
{ {
DetectFloorVisualGroups(); SingletonInstantiation(false, manager =>
{
manager.DetectFloorVisualGroups();
});
} }
protected override void OnBootstrap() private void Start()
{ {
ApplyVisibility(); ApplyVisibility();
} }
protected override void Subscriptions()
{
Subscribe<EmitFloorDetectionEvent>(e =>
{
floorDetection = e.FloorDetection;
});
}
private void Update() private void Update()
{ {
ApplyVisibility(); ApplyVisibility();

View File

@ -4,7 +4,7 @@ using Intrepid.Utilities;
using Sirenix.OdinInspector; using Sirenix.OdinInspector;
using UnityEngine; using UnityEngine;
namespace Intrepid.Gameplay.Flooring namespace Temporary
{ {
public struct VisibilityRequest public struct VisibilityRequest
{ {

View File

@ -5,7 +5,7 @@
"depth": 0, "depth": 0,
"source": "git", "source": "git",
"dependencies": {}, "dependencies": {},
"hash": "be2ea033f2bea17b65f158f686a54458e8cd9606" "hash": "70ff157eeecf2ff71b1ce2e1ff089f279d75507e"
}, },
"com.unity.2d.animation": { "com.unity.2d.animation": {
"version": "13.0.5", "version": "13.0.5",