From 0d968f75abc33a6d6f070677282a1f81787ca6ab Mon Sep 17 00:00:00 2001 From: Ferlat Thibaud Date: Mon, 16 Mar 2026 17:06:47 +0100 Subject: [PATCH] Hallucination system --- .../Prefabs/securityCamera_A.prefab | 2 +- .../V_Octocore/Prefabs/OctoPlayerFP.prefab | 51 - .../Unheimlich_POC/Data/Hallucinations.meta | 8 + .../Data/Hallucinations/HE_RoomB_Entry.asset | 20 + .../Hallucinations/HE_RoomB_Entry.asset.meta | 8 + .../Scenes/DemoOne/DemoOne.unity | 1595 ++++++++++------- .../Hallucinations Volume Profile.asset | 167 ++ .../Hallucinations Volume Profile.asset.meta | 8 + .../Scripts/Core/Events/GameEventTrigger.cs | 96 + .../Core/Events/GameEventTrigger.cs.meta | 2 + .../Scripts/Core/Events/TriggerZoneBase.cs | 87 + .../Core/Events/TriggerZoneBase.cs.meta | 2 + .../Interaction/ObjectDescriptionTrigger.cs | 59 +- .../Scripts/Core/Managers/Singleton.cs | 48 +- .../Scripts/Core/Utils/GameSessionResetter.cs | 25 + .../Core/Utils/GameSessionResetter.cs.meta | 2 + .../Runtime/ClueUnlockTrigger.cs | 119 +- .../Runtime/DetectiveBoardController.cs | 8 + .../DetectiveBoard/UI/ClueHandCard.cs | 122 ++ .../DetectiveBoard/UI/ClueHandCard.cs.meta | 2 + .../Features/DetectiveBoard/UI/ClueHandUI.cs | 252 +++ .../DetectiveBoard/UI/ClueHandUI.cs.meta | 2 + .../DetectiveBoard/UI/DetectiveBoardCanvas.cs | 57 +- .../UI/DetectiveBoardInteraction.cs | 40 +- .../Dialogue/Runtime/DialogueManager.cs | 42 +- .../Dialogue/Runtime/DialogueTriggerZone.cs | 50 +- .../Dialogue/UI/ChoiceFocusHandler.cs | 13 +- .../Scripts/Features/Hallucination.meta | 8 + .../Scripts/Features/Hallucination/Data.meta | 8 + .../Hallucination/Data/HallucinationEvent.cs | 42 + .../Data/HallucinationEvent.cs.meta | 2 + .../Features/Hallucination/Runtime.meta | 8 + .../Runtime/HallucinationManager.cs | 272 +++ .../Runtime/HallucinationManager.cs.meta | 2 + .../Runtime/HallucinationOnAudio.cs | 126 ++ .../Runtime/HallucinationOnAudio.cs.meta | 2 + .../Runtime/HallucinationTrigger.cs | 68 + .../Runtime/HallucinationTrigger.cs.meta | 2 + .../Runtime/HallucinationTriggerZone.cs | 34 + .../Runtime/HallucinationTriggerZone.cs.meta | 2 + .../Runtime/HallucinationWordSpawner.cs | 248 +++ .../Runtime/HallucinationWordSpawner.cs.meta | 2 + .../Player/Runtime/ListeningVignetteEffect.cs | 6 + .../Runtime/DetectiveBoardVirtualCamera.cs | 50 +- 44 files changed, 2860 insertions(+), 909 deletions(-) create mode 100644 Assets/Unheimlich_POC/Data/Hallucinations.meta create mode 100644 Assets/Unheimlich_POC/Data/Hallucinations/HE_RoomB_Entry.asset create mode 100644 Assets/Unheimlich_POC/Data/Hallucinations/HE_RoomB_Entry.asset.meta create mode 100644 Assets/Unheimlich_POC/Scenes/DemoOne/Hallucinations Volume Profile.asset create mode 100644 Assets/Unheimlich_POC/Scenes/DemoOne/Hallucinations Volume Profile.asset.meta create mode 100644 Assets/Unheimlich_POC/Scripts/Core/Events/GameEventTrigger.cs create mode 100644 Assets/Unheimlich_POC/Scripts/Core/Events/GameEventTrigger.cs.meta create mode 100644 Assets/Unheimlich_POC/Scripts/Core/Events/TriggerZoneBase.cs create mode 100644 Assets/Unheimlich_POC/Scripts/Core/Events/TriggerZoneBase.cs.meta create mode 100644 Assets/Unheimlich_POC/Scripts/Core/Utils/GameSessionResetter.cs create mode 100644 Assets/Unheimlich_POC/Scripts/Core/Utils/GameSessionResetter.cs.meta create mode 100644 Assets/Unheimlich_POC/Scripts/Features/DetectiveBoard/UI/ClueHandCard.cs create mode 100644 Assets/Unheimlich_POC/Scripts/Features/DetectiveBoard/UI/ClueHandCard.cs.meta create mode 100644 Assets/Unheimlich_POC/Scripts/Features/DetectiveBoard/UI/ClueHandUI.cs create mode 100644 Assets/Unheimlich_POC/Scripts/Features/DetectiveBoard/UI/ClueHandUI.cs.meta create mode 100644 Assets/Unheimlich_POC/Scripts/Features/Hallucination.meta create mode 100644 Assets/Unheimlich_POC/Scripts/Features/Hallucination/Data.meta create mode 100644 Assets/Unheimlich_POC/Scripts/Features/Hallucination/Data/HallucinationEvent.cs create mode 100644 Assets/Unheimlich_POC/Scripts/Features/Hallucination/Data/HallucinationEvent.cs.meta create mode 100644 Assets/Unheimlich_POC/Scripts/Features/Hallucination/Runtime.meta create mode 100644 Assets/Unheimlich_POC/Scripts/Features/Hallucination/Runtime/HallucinationManager.cs create mode 100644 Assets/Unheimlich_POC/Scripts/Features/Hallucination/Runtime/HallucinationManager.cs.meta create mode 100644 Assets/Unheimlich_POC/Scripts/Features/Hallucination/Runtime/HallucinationOnAudio.cs create mode 100644 Assets/Unheimlich_POC/Scripts/Features/Hallucination/Runtime/HallucinationOnAudio.cs.meta create mode 100644 Assets/Unheimlich_POC/Scripts/Features/Hallucination/Runtime/HallucinationTrigger.cs create mode 100644 Assets/Unheimlich_POC/Scripts/Features/Hallucination/Runtime/HallucinationTrigger.cs.meta create mode 100644 Assets/Unheimlich_POC/Scripts/Features/Hallucination/Runtime/HallucinationTriggerZone.cs create mode 100644 Assets/Unheimlich_POC/Scripts/Features/Hallucination/Runtime/HallucinationTriggerZone.cs.meta create mode 100644 Assets/Unheimlich_POC/Scripts/Features/Hallucination/Runtime/HallucinationWordSpawner.cs create mode 100644 Assets/Unheimlich_POC/Scripts/Features/Hallucination/Runtime/HallucinationWordSpawner.cs.meta diff --git a/Assets/Unheimlich_POC/Content/Environment/OctoVersion/Props/SecurityCamera/Prefabs/securityCamera_A.prefab b/Assets/Unheimlich_POC/Content/Environment/OctoVersion/Props/SecurityCamera/Prefabs/securityCamera_A.prefab index 35c5edd3..1d80e94c 100644 --- a/Assets/Unheimlich_POC/Content/Environment/OctoVersion/Props/SecurityCamera/Prefabs/securityCamera_A.prefab +++ b/Assets/Unheimlich_POC/Content/Environment/OctoVersion/Props/SecurityCamera/Prefabs/securityCamera_A.prefab @@ -158,7 +158,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 2100000, guid: 330dec4f7aa07334693179a8ae85c898, type: 2} + - {fileID: 2100000, guid: a4126e3e799efbc488e713f4ca63ab49, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 diff --git a/Assets/Unheimlich_POC/Content/Gameplay/Characters/Player/V_Octocore/Prefabs/OctoPlayerFP.prefab b/Assets/Unheimlich_POC/Content/Gameplay/Characters/Player/V_Octocore/Prefabs/OctoPlayerFP.prefab index d864ef9f..1eb7303b 100644 --- a/Assets/Unheimlich_POC/Content/Gameplay/Characters/Player/V_Octocore/Prefabs/OctoPlayerFP.prefab +++ b/Assets/Unheimlich_POC/Content/Gameplay/Characters/Player/V_Octocore/Prefabs/OctoPlayerFP.prefab @@ -367,7 +367,6 @@ GameObject: m_Component: - component: {fileID: 3867316379480422796} - component: {fileID: 1942933376864229506} - - component: {fileID: 1306787889985282719} - component: {fileID: 1381459755705258711} m_Layer: 0 m_Name: DetectiveBoardVirtualCamera @@ -442,56 +441,6 @@ Camera: m_OcclusionCulling: 1 m_StereoConvergence: 10 m_StereoSeparation: 0.022 ---- !u!114 &1306787889985282719 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 6184255431701975184} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: df440cd4d3cc30d4e9f5b44ab4931a12, type: 3} - m_Name: - m_EditorClassIdentifier: Assembly-CSharp::Unheimlich.Gameplay.CameraControl.DetectiveBoardVirtualCamera - _virtualCamera: {fileID: 0} - _transitionSpeed: 3 - _transitionCurve: - serializedVersion: 2 - m_Curve: - - serializedVersion: 3 - time: 0 - value: 0 - inSlope: 0 - outSlope: 0 - tangentMode: 0 - weightedMode: 0 - inWeight: 0 - outWeight: 0 - - serializedVersion: 3 - time: 1 - value: 1 - inSlope: 0 - outSlope: 0 - tangentMode: 0 - weightedMode: 0 - inWeight: 0 - outWeight: 0 - m_PreInfinity: 2 - m_PostInfinity: 2 - m_RotationOrder: 4 - _initialDistance: 1.5 - _panSpeed: 2 - _panSmoothTime: 0.2 - _edgeBorderSize: 0.1 - _maxPanOffset: {x: 1.5, y: 0.5} - _useDynamicPanLimits: 1 - _panMargin: 0.05 - _minDistance: 0.5 - _maxDistance: 3 - _zoomSpeed: 2 - _zoomSmoothTime: 0.15 - _scrollSensitivity: 0.3 --- !u!114 &1381459755705258711 MonoBehaviour: m_ObjectHideFlags: 0 diff --git a/Assets/Unheimlich_POC/Data/Hallucinations.meta b/Assets/Unheimlich_POC/Data/Hallucinations.meta new file mode 100644 index 00000000..8a85c94d --- /dev/null +++ b/Assets/Unheimlich_POC/Data/Hallucinations.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3720c98e23174d8418e04d8b445faed1 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Unheimlich_POC/Data/Hallucinations/HE_RoomB_Entry.asset b/Assets/Unheimlich_POC/Data/Hallucinations/HE_RoomB_Entry.asset new file mode 100644 index 00000000..33a5a164 --- /dev/null +++ b/Assets/Unheimlich_POC/Data/Hallucinations/HE_RoomB_Entry.asset @@ -0,0 +1,20 @@ +%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: b4c627a455825134087ba8c6f8931aed, type: 3} + m_Name: + m_EditorClassIdentifier: Assembly-CSharp::Unheimlich.Features.Hallucination.HallucinationEvent + _label: 'RoomB Entry Vision ' + _spawnGhostWord: 1 + _ghostWordText: 'Ils savent ' + _ghostWordSpawnOffset: {x: 0, y: 1.5, z: 2} + _ghostWordLifetime: 3 + _sanityCost: 0.2 diff --git a/Assets/Unheimlich_POC/Data/Hallucinations/HE_RoomB_Entry.asset.meta b/Assets/Unheimlich_POC/Data/Hallucinations/HE_RoomB_Entry.asset.meta new file mode 100644 index 00000000..b67999da --- /dev/null +++ b/Assets/Unheimlich_POC/Data/Hallucinations/HE_RoomB_Entry.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 11ffb12bd28a98f40a40a63db49d7df3 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Unheimlich_POC/Scenes/DemoOne/DemoOne.unity b/Assets/Unheimlich_POC/Scenes/DemoOne/DemoOne.unity index d9a0f97b..9369cfe5 100644 --- a/Assets/Unheimlich_POC/Scenes/DemoOne/DemoOne.unity +++ b/Assets/Unheimlich_POC/Scenes/DemoOne/DemoOne.unity @@ -1068,14 +1068,14 @@ PrefabInstance: objectReference: {fileID: 0} m_RemovedComponents: [] m_RemovedGameObjects: [] - m_AddedGameObjects: - - targetCorrespondingSourceObject: {fileID: 3004237604350797358, guid: 36d14973b89f7394bbd6f40658c7928b, type: 3} - insertIndex: -1 - addedObject: {fileID: 954779985} + m_AddedGameObjects: [] m_AddedComponents: - targetCorrespondingSourceObject: {fileID: 2079432218326392936, guid: 36d14973b89f7394bbd6f40658c7928b, type: 3} insertIndex: -1 addedObject: {fileID: 1238989072} + - targetCorrespondingSourceObject: {fileID: 2079432218326392936, guid: 36d14973b89f7394bbd6f40658c7928b, type: 3} + insertIndex: -1 + addedObject: {fileID: 1238989073} - targetCorrespondingSourceObject: {fileID: 1717591919482589208, guid: 36d14973b89f7394bbd6f40658c7928b, type: 3} insertIndex: -1 addedObject: {fileID: 188106429} @@ -1124,11 +1124,11 @@ MonoBehaviour: North: {fileID: 0} Est: {fileID: 1019522718} South: {fileID: 0} - West: {fileID: 1572417348} + West: {fileID: 1081250654} _references: Map: {fileID: 582006397} CeilingInstance: {fileID: 1638081765} - WallInstance: {fileID: 1888798361} + WallInstance: {fileID: 373884458} FloorInstance: {fileID: 1352379881} _infos: Coordinates: {x: 11, y: 0, z: 17} @@ -1148,7 +1148,7 @@ Transform: m_Children: - {fileID: 1352379882} - {fileID: 1638081766} - - {fileID: 1888798362} + - {fileID: 373884459} m_Father: {fileID: 2081616842} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1001 &62528665 @@ -2586,13 +2586,13 @@ MonoBehaviour: Shape: 0 Connections: North: {fileID: 0} - Est: {fileID: 1572417348} + Est: {fileID: 1081250654} South: {fileID: 0} West: {fileID: 2091700462} _references: Map: {fileID: 582006397} CeilingInstance: {fileID: 1032902151} - WallInstance: {fileID: 243796353} + WallInstance: {fileID: 1535662240} FloorInstance: {fileID: 822849138} _infos: Coordinates: {x: 9, y: 0, z: 17} @@ -2612,7 +2612,7 @@ Transform: m_Children: - {fileID: 822849139} - {fileID: 1032902152} - - {fileID: 243796354} + - {fileID: 1535662241} m_Father: {fileID: 2081616842} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &177922894 stripped @@ -2668,9 +2668,9 @@ MonoBehaviour: _debugLimits: 0 _minDistance: 0.5 _maxDistance: 3 - _zoomSpeed: 2 + _zoomSpeed: 5 _zoomSmoothTime: 0.15 - _scrollSensitivity: 0.3 + _scrollSensitivity: 20 --- !u!114 &177922897 MonoBehaviour: m_ObjectHideFlags: 0 @@ -3289,8 +3289,8 @@ MonoBehaviour: Connections: North: {fileID: 0} Est: {fileID: 1807692943} - South: {fileID: 0} - West: {fileID: 0} + South: {fileID: 317140760} + West: {fileID: 1090405263} _references: Map: {fileID: 582006397} CeilingInstance: {fileID: 1956044016} @@ -3754,148 +3754,6 @@ Transform: m_CorrespondingSourceObject: {fileID: 8882158618763774349, guid: 3b7524f919b3d384eb59e639eb9d1f55, type: 3} m_PrefabInstance: {fileID: 233317824} m_PrefabAsset: {fileID: 0} ---- !u!1001 &243796352 -PrefabInstance: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - serializedVersion: 3 - m_TransformParent: {fileID: 170839271} - m_Modifications: - - target: {fileID: 8072724977891578679, guid: 3b7524f919b3d384eb59e639eb9d1f55, type: 3} - propertyPath: m_Name - value: Wall - objectReference: {fileID: 0} - - target: {fileID: 8882158618763774349, guid: 3b7524f919b3d384eb59e639eb9d1f55, type: 3} - propertyPath: m_LocalPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8882158618763774349, guid: 3b7524f919b3d384eb59e639eb9d1f55, type: 3} - propertyPath: m_LocalPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8882158618763774349, guid: 3b7524f919b3d384eb59e639eb9d1f55, type: 3} - propertyPath: m_LocalPosition.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8882158618763774349, guid: 3b7524f919b3d384eb59e639eb9d1f55, type: 3} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 8882158618763774349, guid: 3b7524f919b3d384eb59e639eb9d1f55, type: 3} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8882158618763774349, guid: 3b7524f919b3d384eb59e639eb9d1f55, type: 3} - propertyPath: m_LocalRotation.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8882158618763774349, guid: 3b7524f919b3d384eb59e639eb9d1f55, type: 3} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8882158618763774349, guid: 3b7524f919b3d384eb59e639eb9d1f55, type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8882158618763774349, guid: 3b7524f919b3d384eb59e639eb9d1f55, type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8882158618763774349, guid: 3b7524f919b3d384eb59e639eb9d1f55, type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_RemovedGameObjects: [] - m_AddedGameObjects: [] - m_AddedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: 3b7524f919b3d384eb59e639eb9d1f55, type: 3} ---- !u!1 &243796353 stripped -GameObject: - m_CorrespondingSourceObject: {fileID: 8072724977891578679, guid: 3b7524f919b3d384eb59e639eb9d1f55, type: 3} - m_PrefabInstance: {fileID: 243796352} - m_PrefabAsset: {fileID: 0} ---- !u!4 &243796354 stripped -Transform: - m_CorrespondingSourceObject: {fileID: 8882158618763774349, guid: 3b7524f919b3d384eb59e639eb9d1f55, type: 3} - m_PrefabInstance: {fileID: 243796352} - m_PrefabAsset: {fileID: 0} ---- !u!1001 &244932588 -PrefabInstance: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - serializedVersion: 3 - m_TransformParent: {fileID: 1572417349} - m_Modifications: - - target: {fileID: 817991563840346717, guid: b3d5e59592bfef844943b9f2e18aabf9, type: 3} - propertyPath: m_LocalPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 817991563840346717, guid: b3d5e59592bfef844943b9f2e18aabf9, type: 3} - propertyPath: m_LocalPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 817991563840346717, guid: b3d5e59592bfef844943b9f2e18aabf9, type: 3} - propertyPath: m_LocalPosition.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 817991563840346717, guid: b3d5e59592bfef844943b9f2e18aabf9, type: 3} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 817991563840346717, guid: b3d5e59592bfef844943b9f2e18aabf9, type: 3} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 817991563840346717, guid: b3d5e59592bfef844943b9f2e18aabf9, type: 3} - propertyPath: m_LocalRotation.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 817991563840346717, guid: b3d5e59592bfef844943b9f2e18aabf9, type: 3} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 817991563840346717, guid: b3d5e59592bfef844943b9f2e18aabf9, type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 817991563840346717, guid: b3d5e59592bfef844943b9f2e18aabf9, type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 817991563840346717, guid: b3d5e59592bfef844943b9f2e18aabf9, type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 3810555960743657273, guid: b3d5e59592bfef844943b9f2e18aabf9, type: 3} - propertyPath: m_Name - value: Floor - objectReference: {fileID: 0} - - target: {fileID: 3810555960743657273, guid: b3d5e59592bfef844943b9f2e18aabf9, type: 3} - propertyPath: m_Layer - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8475855517002618517, guid: b3d5e59592bfef844943b9f2e18aabf9, type: 3} - propertyPath: m_Layer - value: 0 - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_RemovedGameObjects: [] - m_AddedGameObjects: [] - m_AddedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: b3d5e59592bfef844943b9f2e18aabf9, type: 3} ---- !u!1 &244932589 stripped -GameObject: - m_CorrespondingSourceObject: {fileID: 3810555960743657273, guid: b3d5e59592bfef844943b9f2e18aabf9, type: 3} - m_PrefabInstance: {fileID: 244932588} - m_PrefabAsset: {fileID: 0} ---- !u!4 &244932590 stripped -Transform: - m_CorrespondingSourceObject: {fileID: 817991563840346717, guid: b3d5e59592bfef844943b9f2e18aabf9, type: 3} - m_PrefabInstance: {fileID: 244932588} - m_PrefabAsset: {fileID: 0} --- !u!1001 &245509753 PrefabInstance: m_ObjectHideFlags: 0 @@ -4419,8 +4277,7 @@ PrefabInstance: value: 10 objectReference: {fileID: 0} m_RemovedComponents: - - {fileID: 6360601081545543910, guid: 524ca0dabcf93844ea5f981410f44310, type: 3} - - {fileID: 1306787889985282719, guid: 524ca0dabcf93844ea5f981410f44310, type: 3} + - {fileID: 0} m_RemovedGameObjects: [] m_AddedGameObjects: [] m_AddedComponents: @@ -5640,6 +5497,7 @@ Transform: - {fileID: 161778414} - {fileID: 2075434742} - {fileID: 1616391087} + - {fileID: 1286690232} m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1001 &349835342 @@ -5801,6 +5659,9 @@ GameObject: - component: {fileID: 360436927} - component: {fileID: 360436928} - component: {fileID: 360436929} + - component: {fileID: 360436931} + - component: {fileID: 360436930} + - component: {fileID: 360436932} m_Layer: 10 m_Name: RoomB m_TagString: Untagged @@ -5846,58 +5707,58 @@ MonoBehaviour: _maxBounds: {x: 19, y: 0, z: 20} _tilesRoot: {fileID: 2138324238} _tiles: - - {fileID: 2124187222} - - {fileID: 2018221532} - - {fileID: 1966203162} - - {fileID: 1916111538} - - {fileID: 1858599999} - - {fileID: 1854904808} - - {fileID: 1805577975} - - {fileID: 1776065554} - - {fileID: 1596512284} - - {fileID: 1573784960} - - {fileID: 1556111475} - - {fileID: 1534650363} - - {fileID: 1515469345} - - {fileID: 1490835241} - - {fileID: 1488568118} - - {fileID: 1359493433} - - {fileID: 1292076245} - - {fileID: 1077265498} - - {fileID: 1067276305} - - {fileID: 1049095639} - - {fileID: 978214104} - - {fileID: 947318234} - - {fileID: 907046323} - - {fileID: 821635054} - - {fileID: 797045252} - - {fileID: 795382345} - - {fileID: 771312550} - - {fileID: 726912091} - - {fileID: 719594784} - - {fileID: 715398034} - - {fileID: 701311839} - - {fileID: 695066148} - - {fileID: 672345281} - {fileID: 616022719} - - {fileID: 571092902} - - {fileID: 562500083} - - {fileID: 550008352} - {fileID: 547887412} - - {fileID: 531406861} + - {fileID: 1292076245} + - {fileID: 81303610} + - {fileID: 1556111475} - {fileID: 466646084} - - {fileID: 368130861} - - {fileID: 320835867} - - {fileID: 313816134} - - {fileID: 223660540} + - {fileID: 726912091} - {fileID: 202558941} + - {fileID: 18266763} + - {fileID: 113951836} + - {fileID: 1359493433} + - {fileID: 672345281} + - {fileID: 2124187222} + - {fileID: 1805577975} + - {fileID: 2018221532} + - {fileID: 719594784} + - {fileID: 821635054} + - {fileID: 313816134} + - {fileID: 797045252} + - {fileID: 1534650363} + - {fileID: 119900065} + - {fileID: 1596512284} + - {fileID: 701311839} + - {fileID: 1858599999} + - {fileID: 947318234} + - {fileID: 562500083} + - {fileID: 1488568118} + - {fileID: 1049095639} + - {fileID: 571092902} + - {fileID: 550008352} + - {fileID: 320835867} + - {fileID: 1573784960} + - {fileID: 368130861} + - {fileID: 771312550} + - {fileID: 1077265498} + - {fileID: 1966203162} + - {fileID: 978214104} + - {fileID: 1490835241} + - {fileID: 907046323} + - {fileID: 223660540} + - {fileID: 531406861} + - {fileID: 795382345} + - {fileID: 1067276305} + - {fileID: 695066148} + - {fileID: 152452649} + - {fileID: 1916111538} + - {fileID: 1854904808} + - {fileID: 715398034} - {fileID: 197403794} - {fileID: 185205363} - - {fileID: 152452649} - - {fileID: 119900065} - - {fileID: 113951836} - - {fileID: 81303610} - - {fileID: 18266763} + - {fileID: 1776065554} + - {fileID: 1515469345} _floors: - Columns: - Rows: @@ -6003,15 +5864,64 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: f33be20afd5d4c843a800ba1d8dd8437, type: 3} m_Name: m_EditorClassIdentifier: Assembly-CSharp::Unheimlich.Interactions.Dialogues.DialogueTriggerZone + _playerTag: Player + _gizmoColor: {r: 0.8, g: 0.5, b: 0, a: 0.35} _conversation: {fileID: 11400000, guid: ebd856967a3b7d342a7d4a3a17c6149f, type: 2} _isRetriggerable: 1 - _requirePlayerTag: 1 - _playerTag: Player _pauseOnExit: 1 _floatingWordAnchor: {fileID: 1029059055} _animationSettings: {fileID: 11400000, guid: da7719558573c894e81bd9b85400681b, type: 2} _localDialogueUI: {fileID: 1029059056} _enableBlurEffect: 1 +--- !u!114 &360436930 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 360436924} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e8fd091b4319d48448d266a24e885dae, type: 3} + m_Name: + m_EditorClassIdentifier: Assembly-CSharp::Unheimlich.Features.Hallucination.HallucinationTriggerZone + _playerTag: Player + _gizmoColor: {r: 0.8, g: 0.5, b: 0, a: 0.35} + _retriggerable: 1 +--- !u!114 &360436931 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 360436924} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 358c75d041ea30a4ab85380893077e70, type: 3} + m_Name: + m_EditorClassIdentifier: Assembly-CSharp::Unheimlich.Core.Events.GameEventTrigger + _fireOnStart: 0 + _fireOnEnable: 0 + _delay: 0 + _fireOnlyOnce: 0 + _onTriggered: + m_PersistentCalls: + m_Calls: [] +--- !u!114 &360436932 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 360436924} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5e1119e5c406d0346b0350dbcc91845f, type: 3} + m_Name: + m_EditorClassIdentifier: Assembly-CSharp::Unheimlich.Features.Hallucination.HallucinationTrigger + _insanityAmount: 0.2 + _hallucinationEvent: {fileID: 11400000, guid: 11ffb12bd28a98f40a40a63db49d7df3, type: 2} + _debugMode: 0 --- !u!1001 &362081299 PrefabInstance: m_ObjectHideFlags: 0 @@ -6401,6 +6311,73 @@ Transform: - {fileID: 1000995307} m_Father: {fileID: 582006396} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1001 &373884457 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 53327395} + m_Modifications: + - target: {fileID: 8072724977891578679, guid: 3b7524f919b3d384eb59e639eb9d1f55, type: 3} + propertyPath: m_Name + value: Wall + objectReference: {fileID: 0} + - target: {fileID: 8882158618763774349, guid: 3b7524f919b3d384eb59e639eb9d1f55, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8882158618763774349, guid: 3b7524f919b3d384eb59e639eb9d1f55, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8882158618763774349, guid: 3b7524f919b3d384eb59e639eb9d1f55, type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8882158618763774349, guid: 3b7524f919b3d384eb59e639eb9d1f55, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 8882158618763774349, guid: 3b7524f919b3d384eb59e639eb9d1f55, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8882158618763774349, guid: 3b7524f919b3d384eb59e639eb9d1f55, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8882158618763774349, guid: 3b7524f919b3d384eb59e639eb9d1f55, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8882158618763774349, guid: 3b7524f919b3d384eb59e639eb9d1f55, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8882158618763774349, guid: 3b7524f919b3d384eb59e639eb9d1f55, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8882158618763774349, guid: 3b7524f919b3d384eb59e639eb9d1f55, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 3b7524f919b3d384eb59e639eb9d1f55, type: 3} +--- !u!1 &373884458 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 8072724977891578679, guid: 3b7524f919b3d384eb59e639eb9d1f55, type: 3} + m_PrefabInstance: {fileID: 373884457} + m_PrefabAsset: {fileID: 0} +--- !u!4 &373884459 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 8882158618763774349, guid: 3b7524f919b3d384eb59e639eb9d1f55, type: 3} + m_PrefabInstance: {fileID: 373884457} + m_PrefabAsset: {fileID: 0} --- !u!1001 &381591815 PrefabInstance: m_ObjectHideFlags: 0 @@ -6579,6 +6556,61 @@ Transform: - {fileID: 1942446568} m_Father: {fileID: 360436925} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &390202388 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 390202389} + - component: {fileID: 390202390} + m_Layer: 0 + m_Name: ClueHand + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &390202389 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 390202388} + 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: 555510769} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0} + m_AnchorMax: {x: 0.5, y: 0} + m_AnchoredPosition: {x: 0, y: 100} + m_SizeDelta: {x: 100, y: 100} + m_Pivot: {x: 0.5, y: 0} +--- !u!114 &390202390 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 390202388} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ace0b6173dad68f47a97505680f54d4e, type: 3} + m_Name: + m_EditorClassIdentifier: Assembly-CSharp::Unheimlich.Features.DetectiveBoard.UI.ClueHandUI + _postItNodePrefab: {fileID: 7846882426873689123, guid: a9f97c7c1680277458e17d17c4e255c5, type: 3} + _handContainer: {fileID: 390202389} + _cardSpacingPixels: 80 + _fanArcRadius: 800 + _cardBaseY: -120 + _maxFanHalfAngle: 40 + _placementLerpSpeed: 5 --- !u!1001 &415691292 PrefabInstance: m_ObjectHideFlags: 0 @@ -6729,6 +6761,55 @@ Transform: m_CorrespondingSourceObject: {fileID: 817991563840346717, guid: b3d5e59592bfef844943b9f2e18aabf9, type: 3} m_PrefabInstance: {fileID: 421624686} m_PrefabAsset: {fileID: 0} +--- !u!1 &426268208 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 426268210} + - component: {fileID: 426268209} + m_Layer: 0 + m_Name: Hallucination Volume + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &426268209 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 426268208} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 172515602e62fb746b5d573b38a5fe58, type: 3} + m_Name: + m_EditorClassIdentifier: Unity.RenderPipelines.Core.Runtime::UnityEngine.Rendering.Volume + m_IsGlobal: 1 + priority: 1 + blendDistance: 0 + weight: 0 + sharedProfile: {fileID: 11400000, guid: 1205a1bec127aa14aa7c48f120b84eb7, type: 2} +--- !u!4 &426268210 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 426268208} + 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!1 &436357569 GameObject: m_ObjectHideFlags: 0 @@ -6842,7 +6923,7 @@ MonoBehaviour: Shape: 0 Connections: North: {fileID: 0} - Est: {fileID: 0} + Est: {fileID: 1090405263} South: {fileID: 0} West: {fileID: 147339870} _references: @@ -7872,6 +7953,73 @@ Transform: - {fileID: 1989367530} m_Father: {fileID: 2138324238} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1001 &541496755 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 1116054940} + m_Modifications: + - target: {fileID: 8072724977891578679, guid: 3b7524f919b3d384eb59e639eb9d1f55, type: 3} + propertyPath: m_Name + value: Wall + objectReference: {fileID: 0} + - target: {fileID: 8882158618763774349, guid: 3b7524f919b3d384eb59e639eb9d1f55, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8882158618763774349, guid: 3b7524f919b3d384eb59e639eb9d1f55, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8882158618763774349, guid: 3b7524f919b3d384eb59e639eb9d1f55, type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8882158618763774349, guid: 3b7524f919b3d384eb59e639eb9d1f55, type: 3} + propertyPath: m_LocalRotation.w + value: 0.7071068 + objectReference: {fileID: 0} + - target: {fileID: 8882158618763774349, guid: 3b7524f919b3d384eb59e639eb9d1f55, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8882158618763774349, guid: 3b7524f919b3d384eb59e639eb9d1f55, type: 3} + propertyPath: m_LocalRotation.y + value: 0.7071068 + objectReference: {fileID: 0} + - target: {fileID: 8882158618763774349, guid: 3b7524f919b3d384eb59e639eb9d1f55, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8882158618763774349, guid: 3b7524f919b3d384eb59e639eb9d1f55, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8882158618763774349, guid: 3b7524f919b3d384eb59e639eb9d1f55, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8882158618763774349, guid: 3b7524f919b3d384eb59e639eb9d1f55, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 3b7524f919b3d384eb59e639eb9d1f55, type: 3} +--- !u!1 &541496756 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 8072724977891578679, guid: 3b7524f919b3d384eb59e639eb9d1f55, type: 3} + m_PrefabInstance: {fileID: 541496755} + m_PrefabAsset: {fileID: 0} +--- !u!4 &541496757 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 8882158618763774349, guid: 3b7524f919b3d384eb59e639eb9d1f55, type: 3} + m_PrefabInstance: {fileID: 541496755} + m_PrefabAsset: {fileID: 0} --- !u!1 &547887411 GameObject: m_ObjectHideFlags: 0 @@ -8880,24 +9028,24 @@ MonoBehaviour: - {fileID: 1800935713} - {fileID: 1709336522} - {fileID: 741456577} - - {fileID: 1029129260} + - {fileID: 317140760} - {fileID: 205545108} - Rows: - {fileID: 147339870} - {fileID: 440493792} - - {fileID: 1728763278} + - {fileID: 1090405263} - {fileID: 205588911} - {fileID: 1807692943} - Rows: - {fileID: 670779819} - {fileID: 1036705095} - - {fileID: 1909643647} + - {fileID: 1116054939} - {fileID: 1694835115} - {fileID: 383472009} - Rows: - {fileID: 2091700462} - {fileID: 170839270} - - {fileID: 1572417348} + - {fileID: 1081250654} - {fileID: 53327394} - {fileID: 1019522718} --- !u!114 &582006398 @@ -11151,8 +11299,8 @@ MonoBehaviour: Type: 0 Shape: 0 Connections: - North: {fileID: 0} - Est: {fileID: 0} + North: {fileID: 1090405263} + Est: {fileID: 317140760} South: {fileID: 722216383} West: {fileID: 0} _references: @@ -11399,6 +11547,81 @@ Transform: m_CorrespondingSourceObject: {fileID: 337221248157638853, guid: 9d4ef384d30b05644add2b0f2671172d, type: 3} m_PrefabInstance: {fileID: 751297672} m_PrefabAsset: {fileID: 0} +--- !u!1001 &754930263 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 1081250655} + m_Modifications: + - target: {fileID: 337221248157638853, guid: 9d4ef384d30b05644add2b0f2671172d, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 337221248157638853, guid: 9d4ef384d30b05644add2b0f2671172d, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 337221248157638853, guid: 9d4ef384d30b05644add2b0f2671172d, type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 337221248157638853, guid: 9d4ef384d30b05644add2b0f2671172d, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 337221248157638853, guid: 9d4ef384d30b05644add2b0f2671172d, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 337221248157638853, guid: 9d4ef384d30b05644add2b0f2671172d, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 337221248157638853, guid: 9d4ef384d30b05644add2b0f2671172d, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 337221248157638853, guid: 9d4ef384d30b05644add2b0f2671172d, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 337221248157638853, guid: 9d4ef384d30b05644add2b0f2671172d, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 337221248157638853, guid: 9d4ef384d30b05644add2b0f2671172d, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2291049519197854382, guid: 9d4ef384d30b05644add2b0f2671172d, type: 3} + propertyPath: m_Layer + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7977652778530834609, guid: 9d4ef384d30b05644add2b0f2671172d, type: 3} + propertyPath: m_Name + value: Ceiling + objectReference: {fileID: 0} + - target: {fileID: 7977652778530834609, guid: 9d4ef384d30b05644add2b0f2671172d, type: 3} + propertyPath: m_Layer + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 9d4ef384d30b05644add2b0f2671172d, type: 3} +--- !u!1 &754930264 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 7977652778530834609, guid: 9d4ef384d30b05644add2b0f2671172d, type: 3} + m_PrefabInstance: {fileID: 754930263} + m_PrefabAsset: {fileID: 0} +--- !u!4 &754930265 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 337221248157638853, guid: 9d4ef384d30b05644add2b0f2671172d, type: 3} + m_PrefabInstance: {fileID: 754930263} + m_PrefabAsset: {fileID: 0} --- !u!1 &771312549 GameObject: m_ObjectHideFlags: 0 @@ -18265,108 +18488,6 @@ Transform: - {fileID: 1465802849} m_Father: {fileID: 2138324238} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!1001 &954779984 -PrefabInstance: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - serializedVersion: 3 - m_TransformParent: {fileID: 1077922943} - m_Modifications: - - target: {fileID: 7591763859490843308, guid: a9f97c7c1680277458e17d17c4e255c5, type: 3} - propertyPath: m_Pivot.x - value: 0.5 - objectReference: {fileID: 0} - - target: {fileID: 7591763859490843308, guid: a9f97c7c1680277458e17d17c4e255c5, type: 3} - propertyPath: m_Pivot.y - value: 0.5 - objectReference: {fileID: 0} - - target: {fileID: 7591763859490843308, guid: a9f97c7c1680277458e17d17c4e255c5, type: 3} - propertyPath: m_AnchorMax.x - value: 0.5 - objectReference: {fileID: 0} - - target: {fileID: 7591763859490843308, guid: a9f97c7c1680277458e17d17c4e255c5, type: 3} - propertyPath: m_AnchorMax.y - value: 0.5 - objectReference: {fileID: 0} - - target: {fileID: 7591763859490843308, guid: a9f97c7c1680277458e17d17c4e255c5, type: 3} - propertyPath: m_AnchorMin.x - value: 0.5 - objectReference: {fileID: 0} - - target: {fileID: 7591763859490843308, guid: a9f97c7c1680277458e17d17c4e255c5, type: 3} - propertyPath: m_AnchorMin.y - value: 0.5 - objectReference: {fileID: 0} - - target: {fileID: 7591763859490843308, guid: a9f97c7c1680277458e17d17c4e255c5, type: 3} - propertyPath: m_SizeDelta.x - value: 200 - objectReference: {fileID: 0} - - target: {fileID: 7591763859490843308, guid: a9f97c7c1680277458e17d17c4e255c5, type: 3} - propertyPath: m_SizeDelta.y - value: 150 - objectReference: {fileID: 0} - - target: {fileID: 7591763859490843308, guid: a9f97c7c1680277458e17d17c4e255c5, type: 3} - propertyPath: m_LocalPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 7591763859490843308, guid: a9f97c7c1680277458e17d17c4e255c5, type: 3} - propertyPath: m_LocalPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 7591763859490843308, guid: a9f97c7c1680277458e17d17c4e255c5, type: 3} - propertyPath: m_LocalPosition.z - value: -0 - objectReference: {fileID: 0} - - target: {fileID: 7591763859490843308, guid: a9f97c7c1680277458e17d17c4e255c5, type: 3} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 7591763859490843308, guid: a9f97c7c1680277458e17d17c4e255c5, type: 3} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 7591763859490843308, guid: a9f97c7c1680277458e17d17c4e255c5, type: 3} - propertyPath: m_LocalRotation.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 7591763859490843308, guid: a9f97c7c1680277458e17d17c4e255c5, type: 3} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 7591763859490843308, guid: a9f97c7c1680277458e17d17c4e255c5, type: 3} - propertyPath: m_AnchoredPosition.x - value: 5.3 - objectReference: {fileID: 0} - - target: {fileID: 7591763859490843308, guid: a9f97c7c1680277458e17d17c4e255c5, type: 3} - propertyPath: m_AnchoredPosition.y - value: -14.1 - objectReference: {fileID: 0} - - target: {fileID: 7591763859490843308, guid: a9f97c7c1680277458e17d17c4e255c5, type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 7591763859490843308, guid: a9f97c7c1680277458e17d17c4e255c5, type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 7591763859490843308, guid: a9f97c7c1680277458e17d17c4e255c5, type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 7846882426873689123, guid: a9f97c7c1680277458e17d17c4e255c5, type: 3} - propertyPath: m_Name - value: PostItNode - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_RemovedGameObjects: [] - m_AddedGameObjects: [] - m_AddedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: a9f97c7c1680277458e17d17c4e255c5, type: 3} ---- !u!224 &954779985 stripped -RectTransform: - m_CorrespondingSourceObject: {fileID: 7591763859490843308, guid: a9f97c7c1680277458e17d17c4e255c5, type: 3} - m_PrefabInstance: {fileID: 954779984} - m_PrefabAsset: {fileID: 0} --- !u!1001 &967171550 PrefabInstance: m_ObjectHideFlags: 0 @@ -18790,6 +18911,81 @@ Transform: m_CorrespondingSourceObject: {fileID: 337221248157638853, guid: 9d4ef384d30b05644add2b0f2671172d, type: 3} m_PrefabInstance: {fileID: 997353844} m_PrefabAsset: {fileID: 0} +--- !u!1001 &1000870846 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 1081250655} + m_Modifications: + - target: {fileID: 817991563840346717, guid: b3d5e59592bfef844943b9f2e18aabf9, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 817991563840346717, guid: b3d5e59592bfef844943b9f2e18aabf9, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 817991563840346717, guid: b3d5e59592bfef844943b9f2e18aabf9, type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 817991563840346717, guid: b3d5e59592bfef844943b9f2e18aabf9, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 817991563840346717, guid: b3d5e59592bfef844943b9f2e18aabf9, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 817991563840346717, guid: b3d5e59592bfef844943b9f2e18aabf9, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 817991563840346717, guid: b3d5e59592bfef844943b9f2e18aabf9, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 817991563840346717, guid: b3d5e59592bfef844943b9f2e18aabf9, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 817991563840346717, guid: b3d5e59592bfef844943b9f2e18aabf9, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 817991563840346717, guid: b3d5e59592bfef844943b9f2e18aabf9, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3810555960743657273, guid: b3d5e59592bfef844943b9f2e18aabf9, type: 3} + propertyPath: m_Name + value: Floor + objectReference: {fileID: 0} + - target: {fileID: 3810555960743657273, guid: b3d5e59592bfef844943b9f2e18aabf9, type: 3} + propertyPath: m_Layer + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8475855517002618517, guid: b3d5e59592bfef844943b9f2e18aabf9, type: 3} + propertyPath: m_Layer + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: b3d5e59592bfef844943b9f2e18aabf9, type: 3} +--- !u!1 &1000870847 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 3810555960743657273, guid: b3d5e59592bfef844943b9f2e18aabf9, type: 3} + m_PrefabInstance: {fileID: 1000870846} + m_PrefabAsset: {fileID: 0} +--- !u!4 &1000870848 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 817991563840346717, guid: b3d5e59592bfef844943b9f2e18aabf9, type: 3} + m_PrefabInstance: {fileID: 1000870846} + m_PrefabAsset: {fileID: 0} --- !u!1 &1000995306 GameObject: m_ObjectHideFlags: 0 @@ -19522,7 +19718,7 @@ MonoBehaviour: Shape: 0 Connections: North: {fileID: 170839270} - Est: {fileID: 0} + Est: {fileID: 1116054939} South: {fileID: 0} West: {fileID: 670779819} _references: @@ -19660,7 +19856,10 @@ PrefabInstance: objectReference: {fileID: 0} m_RemovedComponents: [] m_RemovedGameObjects: [] - m_AddedGameObjects: [] + m_AddedGameObjects: + - targetCorrespondingSourceObject: {fileID: 8886833518829962744, guid: f6df2f5ea61cfcb439be39356b1560fa, type: 3} + insertIndex: -1 + addedObject: {fileID: 390202389} m_AddedComponents: - targetCorrespondingSourceObject: {fileID: 6237475490286447873, guid: f6df2f5ea61cfcb439be39356b1560fa, type: 3} insertIndex: -1 @@ -25016,11 +25215,77 @@ Transform: - {fileID: 1342943158} m_Father: {fileID: 2138324238} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!224 &1077922943 stripped -RectTransform: - m_CorrespondingSourceObject: {fileID: 3004237604350797358, guid: 36d14973b89f7394bbd6f40658c7928b, type: 3} - m_PrefabInstance: {fileID: 47624367} +--- !u!1 &1081250653 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1081250655} + - component: {fileID: 1081250654} + m_Layer: 0 + m_Name: Tile_032 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1081250654 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1081250653} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 52265b52f92cb4846aa9f736eb80cfe1, type: 3} + m_Name: + m_EditorClassIdentifier: OctoCore.Runtime::OctoCore.LevelBuilder.OctoLevelBuilderTile + _configuration: + _overrideStyle: {fileID: 0} + Ceiling: 1 + Wall: 1 + Floor: 1 + Stairs: 0 + _wall: + AutoConnect: 1 + Orientation: 2 + Type: 0 + Shape: 2 + Connections: + North: {fileID: 0} + Est: {fileID: 53327394} + South: {fileID: 1116054939} + West: {fileID: 170839270} + _references: + Map: {fileID: 582006397} + CeilingInstance: {fileID: 754930264} + WallInstance: {fileID: 1355599549} + FloorInstance: {fileID: 1000870847} + _infos: + Coordinates: {x: 10, y: 0, z: 17} + Position: {x: 0, y: 0, z: 4} +--- !u!4 &1081250655 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1081250653} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 4} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 1000870848} + - {fileID: 754930265} + - {fileID: 1355599550} + m_Father: {fileID: 2081616842} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1090405262 GameObject: m_ObjectHideFlags: 0 @@ -25062,7 +25327,7 @@ MonoBehaviour: Type: 1 Shape: 4 Connections: - North: {fileID: 0} + North: {fileID: 1116054939} Est: {fileID: 0} South: {fileID: 0} West: {fileID: 0} @@ -25354,18 +25619,18 @@ MonoBehaviour: Stairs: 0 _wall: AutoConnect: 1 - Orientation: 2 + Orientation: 1 Type: 0 - Shape: 4 + Shape: 0 Connections: - North: {fileID: 1572417348} + North: {fileID: 1081250654} Est: {fileID: 0} - South: {fileID: 0} + South: {fileID: 1090405263} West: {fileID: 0} _references: Map: {fileID: 582006397} CeilingInstance: {fileID: 513262522} - WallInstance: {fileID: 1483472485} + WallInstance: {fileID: 541496756} FloorInstance: {fileID: 1499600592} _infos: Coordinates: {x: 10, y: 0, z: 16} @@ -25385,9 +25650,76 @@ Transform: m_Children: - {fileID: 1499600593} - {fileID: 513262523} - - {fileID: 1483472486} + - {fileID: 541496757} m_Father: {fileID: 2081616842} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1116273214 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1116273215} + - component: {fileID: 1116273217} + - component: {fileID: 1116273216} + m_Layer: 0 + m_Name: HalluTriggerTest + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!4 &1116273215 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1116273214} + 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: 1362233641} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1116273216 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1116273214} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5e1119e5c406d0346b0350dbcc91845f, type: 3} + m_Name: + m_EditorClassIdentifier: Assembly-CSharp::Unheimlich.Features.Hallucination.HallucinationTrigger + _insanityAmount: 1 + _hallucinationEvent: {fileID: 0} + _debugMode: 1 +--- !u!114 &1116273217 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1116273214} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 358c75d041ea30a4ab85380893077e70, type: 3} + m_Name: + m_EditorClassIdentifier: Assembly-CSharp::Unheimlich.Core.Events.GameEventTrigger + _fireOnStart: 1 + _fireOnEnable: 1 + _delay: 0 + _fireOnlyOnce: 1 + _onTriggered: + m_PersistentCalls: + m_Calls: [] --- !u!1001 &1131624267 PrefabInstance: m_ObjectHideFlags: 0 @@ -26876,9 +27208,28 @@ MonoBehaviour: m_EditorClassIdentifier: Assembly-CSharp::Unheimlich.Handlers.DetectiveBoard.ClueUnlockTrigger _clueToUnlock: {fileID: 11400000, guid: 83fbe742b4e7b1a499e7b02c8696edf6, type: 2} _unlockOnStart: 1 - _unlockOnEnable: 0 _unlockDelay: 0 + _unlockOnlyOnce: 1 _debugMode: 0 +--- !u!114 &1238989073 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1038444910} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 358c75d041ea30a4ab85380893077e70, type: 3} + m_Name: + m_EditorClassIdentifier: Assembly-CSharp::Unheimlich.Core.Events.GameEventTrigger + _fireOnStart: 0 + _fireOnEnable: 0 + _delay: 0 + _fireOnlyOnce: 1 + _onTriggered: + m_PersistentCalls: + m_Calls: [] --- !u!1001 &1245878164 PrefabInstance: m_ObjectHideFlags: 0 @@ -27262,6 +27613,99 @@ Transform: m_CorrespondingSourceObject: {fileID: 5403805523961477866, guid: a6fb413fb2bce224e89bd24011beb66a, type: 3} m_PrefabInstance: {fileID: 1268847544} m_PrefabAsset: {fileID: 0} +--- !u!1 &1286690231 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1286690232} + - component: {fileID: 1286690234} + - component: {fileID: 1286690233} + m_Layer: 0 + m_Name: HallucinationManager + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1286690232 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1286690231} + 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: 348657074} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1286690233 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1286690231} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 39db1c5f2a13bc04782e676a6ad133c8, type: 3} + m_Name: + m_EditorClassIdentifier: Assembly-CSharp::Unheimlich.Features.Hallucination.HallucinationWordSpawner + _wordPrefab: {fileID: 8049322106330395133, guid: 21eef1f89c2ea56459505e7c02acbda1, type: 3} + _driftSpeed: 0.4 + _stopDistance: 1.5 + _fadeInDuration: 0.5 + _fadeOutDuration: 0.8 + _shakeRadius: 15 + _shakeSpeed: 2 + _shakeSmoothness: 5 +--- !u!114 &1286690234 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1286690231} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 6806feb984393b441ad0f1b20cf70333, type: 3} + m_Name: + m_EditorClassIdentifier: Assembly-CSharp::Unheimlich.Features.Hallucination.HallucinationManager + _initialSanity: 0 + _sanityRecoveryRate: 0 + _effectLerpSpeed: 2 + _hallucinationVolume: {fileID: 426268209} + _driveChromaticAberration: 1 + _chromaticAberrationMin: 0 + _chromaticAberrationMax: 1 + _driveLensDistortion: 1 + _lensDistortionMin: 0 + _lensDistortionMax: -0.6 + _driveVignette: 1 + _vignetteMin: 0.1 + _vignetteMax: 0.4 + _driveFilmGrain: 1 + _filmGrainMin: 0 + _filmGrainMax: 1 + _driveBloom: 1 + _bloomIntensityMin: 0 + _bloomIntensityMax: 1 + _bloomThresholdMin: 1 + _bloomThresholdMax: 0.5 + _bloomScatterMin: 0 + _bloomScatterMax: 0.7 + _bloomDirtIntensityMin: 0 + _bloomDirtIntensityMax: 0 + _shakeMultiplierAtZero: 1 + _shakeMultiplierAtOne: 3 + _debugMode: 0 --- !u!1 &1292076244 GameObject: m_ObjectHideFlags: 0 @@ -28244,6 +28688,73 @@ Transform: m_CorrespondingSourceObject: {fileID: 817991563840346717, guid: b3d5e59592bfef844943b9f2e18aabf9, type: 3} m_PrefabInstance: {fileID: 1352379880} m_PrefabAsset: {fileID: 0} +--- !u!1001 &1355599548 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 1081250655} + m_Modifications: + - target: {fileID: 3721080204497974684, guid: 8ca762580ee44c242877a7d32b418cc1, type: 3} + propertyPath: m_Name + value: Wall + objectReference: {fileID: 0} + - target: {fileID: 4100595731430551334, guid: 8ca762580ee44c242877a7d32b418cc1, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4100595731430551334, guid: 8ca762580ee44c242877a7d32b418cc1, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4100595731430551334, guid: 8ca762580ee44c242877a7d32b418cc1, type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4100595731430551334, guid: 8ca762580ee44c242877a7d32b418cc1, type: 3} + propertyPath: m_LocalRotation.w + value: -0.00000004371139 + objectReference: {fileID: 0} + - target: {fileID: 4100595731430551334, guid: 8ca762580ee44c242877a7d32b418cc1, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4100595731430551334, guid: 8ca762580ee44c242877a7d32b418cc1, type: 3} + propertyPath: m_LocalRotation.y + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4100595731430551334, guid: 8ca762580ee44c242877a7d32b418cc1, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4100595731430551334, guid: 8ca762580ee44c242877a7d32b418cc1, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4100595731430551334, guid: 8ca762580ee44c242877a7d32b418cc1, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4100595731430551334, guid: 8ca762580ee44c242877a7d32b418cc1, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 8ca762580ee44c242877a7d32b418cc1, type: 3} +--- !u!1 &1355599549 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 3721080204497974684, guid: 8ca762580ee44c242877a7d32b418cc1, type: 3} + m_PrefabInstance: {fileID: 1355599548} + m_PrefabAsset: {fileID: 0} +--- !u!4 &1355599550 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 4100595731430551334, guid: 8ca762580ee44c242877a7d32b418cc1, type: 3} + m_PrefabInstance: {fileID: 1355599548} + m_PrefabAsset: {fileID: 0} --- !u!1 &1359493432 GameObject: m_ObjectHideFlags: 0 @@ -28344,6 +28855,7 @@ Transform: m_ConstrainProportionsScale: 0 m_Children: - {fileID: 1502433911} + - {fileID: 1116273215} m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1001 &1362513422 @@ -30092,73 +30604,6 @@ Transform: m_CorrespondingSourceObject: {fileID: 337221248157638853, guid: 9d4ef384d30b05644add2b0f2671172d, type: 3} m_PrefabInstance: {fileID: 1471754588} m_PrefabAsset: {fileID: 0} ---- !u!1001 &1483472484 -PrefabInstance: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - serializedVersion: 3 - m_TransformParent: {fileID: 1116054940} - m_Modifications: - - target: {fileID: 4805831407497148572, guid: 0f8b0ef3f971ebe4d846f50632e0e370, type: 3} - propertyPath: m_LocalPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4805831407497148572, guid: 0f8b0ef3f971ebe4d846f50632e0e370, type: 3} - propertyPath: m_LocalPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4805831407497148572, guid: 0f8b0ef3f971ebe4d846f50632e0e370, type: 3} - propertyPath: m_LocalPosition.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4805831407497148572, guid: 0f8b0ef3f971ebe4d846f50632e0e370, type: 3} - propertyPath: m_LocalRotation.w - value: -0.00000004371139 - objectReference: {fileID: 0} - - target: {fileID: 4805831407497148572, guid: 0f8b0ef3f971ebe4d846f50632e0e370, type: 3} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4805831407497148572, guid: 0f8b0ef3f971ebe4d846f50632e0e370, type: 3} - propertyPath: m_LocalRotation.y - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 4805831407497148572, guid: 0f8b0ef3f971ebe4d846f50632e0e370, type: 3} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4805831407497148572, guid: 0f8b0ef3f971ebe4d846f50632e0e370, type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4805831407497148572, guid: 0f8b0ef3f971ebe4d846f50632e0e370, type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4805831407497148572, guid: 0f8b0ef3f971ebe4d846f50632e0e370, type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 5330694740221895206, guid: 0f8b0ef3f971ebe4d846f50632e0e370, type: 3} - propertyPath: m_Name - value: Wall - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_RemovedGameObjects: [] - m_AddedGameObjects: [] - m_AddedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: 0f8b0ef3f971ebe4d846f50632e0e370, type: 3} ---- !u!1 &1483472485 stripped -GameObject: - m_CorrespondingSourceObject: {fileID: 5330694740221895206, guid: 0f8b0ef3f971ebe4d846f50632e0e370, type: 3} - m_PrefabInstance: {fileID: 1483472484} - m_PrefabAsset: {fileID: 0} ---- !u!4 &1483472486 stripped -Transform: - m_CorrespondingSourceObject: {fileID: 4805831407497148572, guid: 0f8b0ef3f971ebe4d846f50632e0e370, type: 3} - m_PrefabInstance: {fileID: 1483472484} - m_PrefabAsset: {fileID: 0} --- !u!1 &1488568117 GameObject: m_ObjectHideFlags: 0 @@ -31142,6 +31587,73 @@ Transform: - {fileID: 745984479} m_Father: {fileID: 2138324238} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1001 &1535662239 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 170839271} + m_Modifications: + - target: {fileID: 8072724977891578679, guid: 3b7524f919b3d384eb59e639eb9d1f55, type: 3} + propertyPath: m_Name + value: Wall + objectReference: {fileID: 0} + - target: {fileID: 8882158618763774349, guid: 3b7524f919b3d384eb59e639eb9d1f55, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8882158618763774349, guid: 3b7524f919b3d384eb59e639eb9d1f55, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8882158618763774349, guid: 3b7524f919b3d384eb59e639eb9d1f55, type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8882158618763774349, guid: 3b7524f919b3d384eb59e639eb9d1f55, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 8882158618763774349, guid: 3b7524f919b3d384eb59e639eb9d1f55, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8882158618763774349, guid: 3b7524f919b3d384eb59e639eb9d1f55, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8882158618763774349, guid: 3b7524f919b3d384eb59e639eb9d1f55, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8882158618763774349, guid: 3b7524f919b3d384eb59e639eb9d1f55, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8882158618763774349, guid: 3b7524f919b3d384eb59e639eb9d1f55, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8882158618763774349, guid: 3b7524f919b3d384eb59e639eb9d1f55, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 3b7524f919b3d384eb59e639eb9d1f55, type: 3} +--- !u!1 &1535662240 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 8072724977891578679, guid: 3b7524f919b3d384eb59e639eb9d1f55, type: 3} + m_PrefabInstance: {fileID: 1535662239} + m_PrefabAsset: {fileID: 0} +--- !u!4 &1535662241 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 8882158618763774349, guid: 3b7524f919b3d384eb59e639eb9d1f55, type: 3} + m_PrefabInstance: {fileID: 1535662239} + m_PrefabAsset: {fileID: 0} --- !u!1001 &1542111079 PrefabInstance: m_ObjectHideFlags: 0 @@ -31588,77 +32100,6 @@ Transform: m_CorrespondingSourceObject: {fileID: 817991563840346717, guid: b3d5e59592bfef844943b9f2e18aabf9, type: 3} m_PrefabInstance: {fileID: 1563201300} m_PrefabAsset: {fileID: 0} ---- !u!1 &1572417347 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1572417349} - - component: {fileID: 1572417348} - m_Layer: 0 - m_Name: Tile_022 - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!114 &1572417348 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1572417347} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 52265b52f92cb4846aa9f736eb80cfe1, type: 3} - m_Name: - m_EditorClassIdentifier: OctoCore.Runtime::OctoCore.LevelBuilder.OctoLevelBuilderTile - _configuration: - _overrideStyle: {fileID: 0} - Ceiling: 1 - Wall: 1 - Floor: 1 - Stairs: 0 - _wall: - AutoConnect: 1 - Orientation: 0 - Type: 0 - Shape: 0 - Connections: - North: {fileID: 0} - Est: {fileID: 53327394} - South: {fileID: 0} - West: {fileID: 170839270} - _references: - Map: {fileID: 582006397} - CeilingInstance: {fileID: 1990005474} - WallInstance: {fileID: 1574120237} - FloorInstance: {fileID: 244932589} - _infos: - Coordinates: {x: 10, y: 0, z: 17} - Position: {x: 0, y: 0, z: 4} ---- !u!4 &1572417349 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1572417347} - serializedVersion: 2 - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 4} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: - - {fileID: 244932590} - - {fileID: 1990005475} - - {fileID: 1574120238} - m_Father: {fileID: 2081616842} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1001 &1572509680 PrefabInstance: m_ObjectHideFlags: 0 @@ -31841,73 +32282,6 @@ Transform: - {fileID: 1575846337} m_Father: {fileID: 2138324238} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!1001 &1574120236 -PrefabInstance: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - serializedVersion: 3 - m_TransformParent: {fileID: 1572417349} - m_Modifications: - - target: {fileID: 8072724977891578679, guid: 3b7524f919b3d384eb59e639eb9d1f55, type: 3} - propertyPath: m_Name - value: Wall - objectReference: {fileID: 0} - - target: {fileID: 8882158618763774349, guid: 3b7524f919b3d384eb59e639eb9d1f55, type: 3} - propertyPath: m_LocalPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8882158618763774349, guid: 3b7524f919b3d384eb59e639eb9d1f55, type: 3} - propertyPath: m_LocalPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8882158618763774349, guid: 3b7524f919b3d384eb59e639eb9d1f55, type: 3} - propertyPath: m_LocalPosition.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8882158618763774349, guid: 3b7524f919b3d384eb59e639eb9d1f55, type: 3} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 8882158618763774349, guid: 3b7524f919b3d384eb59e639eb9d1f55, type: 3} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8882158618763774349, guid: 3b7524f919b3d384eb59e639eb9d1f55, type: 3} - propertyPath: m_LocalRotation.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8882158618763774349, guid: 3b7524f919b3d384eb59e639eb9d1f55, type: 3} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8882158618763774349, guid: 3b7524f919b3d384eb59e639eb9d1f55, type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8882158618763774349, guid: 3b7524f919b3d384eb59e639eb9d1f55, type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8882158618763774349, guid: 3b7524f919b3d384eb59e639eb9d1f55, type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_RemovedGameObjects: [] - m_AddedGameObjects: [] - m_AddedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: 3b7524f919b3d384eb59e639eb9d1f55, type: 3} ---- !u!1 &1574120237 stripped -GameObject: - m_CorrespondingSourceObject: {fileID: 8072724977891578679, guid: 3b7524f919b3d384eb59e639eb9d1f55, type: 3} - m_PrefabInstance: {fileID: 1574120236} - m_PrefabAsset: {fileID: 0} ---- !u!4 &1574120238 stripped -Transform: - m_CorrespondingSourceObject: {fileID: 8882158618763774349, guid: 3b7524f919b3d384eb59e639eb9d1f55, type: 3} - m_PrefabInstance: {fileID: 1574120236} - m_PrefabAsset: {fileID: 0} --- !u!1001 &1575846335 PrefabInstance: m_ObjectHideFlags: 0 @@ -32894,7 +33268,7 @@ MonoBehaviour: North: {fileID: 53327394} Est: {fileID: 383472009} South: {fileID: 0} - West: {fileID: 0} + West: {fileID: 1116054939} _references: Map: {fileID: 582006397} CeilingInstance: {fileID: 553889056} @@ -35006,73 +35380,6 @@ Transform: m_CorrespondingSourceObject: {fileID: 337221248157638853, guid: 9d4ef384d30b05644add2b0f2671172d, type: 3} m_PrefabInstance: {fileID: 1866389191} m_PrefabAsset: {fileID: 0} ---- !u!1001 &1888798360 -PrefabInstance: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - serializedVersion: 3 - m_TransformParent: {fileID: 53327395} - m_Modifications: - - target: {fileID: 8072724977891578679, guid: 3b7524f919b3d384eb59e639eb9d1f55, type: 3} - propertyPath: m_Name - value: Wall - objectReference: {fileID: 0} - - target: {fileID: 8882158618763774349, guid: 3b7524f919b3d384eb59e639eb9d1f55, type: 3} - propertyPath: m_LocalPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8882158618763774349, guid: 3b7524f919b3d384eb59e639eb9d1f55, type: 3} - propertyPath: m_LocalPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8882158618763774349, guid: 3b7524f919b3d384eb59e639eb9d1f55, type: 3} - propertyPath: m_LocalPosition.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8882158618763774349, guid: 3b7524f919b3d384eb59e639eb9d1f55, type: 3} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 8882158618763774349, guid: 3b7524f919b3d384eb59e639eb9d1f55, type: 3} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8882158618763774349, guid: 3b7524f919b3d384eb59e639eb9d1f55, type: 3} - propertyPath: m_LocalRotation.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8882158618763774349, guid: 3b7524f919b3d384eb59e639eb9d1f55, type: 3} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8882158618763774349, guid: 3b7524f919b3d384eb59e639eb9d1f55, type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8882158618763774349, guid: 3b7524f919b3d384eb59e639eb9d1f55, type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8882158618763774349, guid: 3b7524f919b3d384eb59e639eb9d1f55, type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_RemovedGameObjects: [] - m_AddedGameObjects: [] - m_AddedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: 3b7524f919b3d384eb59e639eb9d1f55, type: 3} ---- !u!1 &1888798361 stripped -GameObject: - m_CorrespondingSourceObject: {fileID: 8072724977891578679, guid: 3b7524f919b3d384eb59e639eb9d1f55, type: 3} - m_PrefabInstance: {fileID: 1888798360} - m_PrefabAsset: {fileID: 0} ---- !u!4 &1888798362 stripped -Transform: - m_CorrespondingSourceObject: {fileID: 8882158618763774349, guid: 3b7524f919b3d384eb59e639eb9d1f55, type: 3} - m_PrefabInstance: {fileID: 1888798360} - m_PrefabAsset: {fileID: 0} --- !u!1001 &1890793491 PrefabInstance: m_ObjectHideFlags: 0 @@ -35292,7 +35599,7 @@ MonoBehaviour: Type: 0 Shape: 0 Connections: - North: {fileID: 1572417348} + North: {fileID: 0} Est: {fileID: 0} South: {fileID: 0} West: {fileID: 0} @@ -36360,81 +36667,6 @@ Transform: m_CorrespondingSourceObject: {fileID: 337221248157638853, guid: 9d4ef384d30b05644add2b0f2671172d, type: 3} m_PrefabInstance: {fileID: 1989367528} m_PrefabAsset: {fileID: 0} ---- !u!1001 &1990005473 -PrefabInstance: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - serializedVersion: 3 - m_TransformParent: {fileID: 1572417349} - m_Modifications: - - target: {fileID: 337221248157638853, guid: 9d4ef384d30b05644add2b0f2671172d, type: 3} - propertyPath: m_LocalPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 337221248157638853, guid: 9d4ef384d30b05644add2b0f2671172d, type: 3} - propertyPath: m_LocalPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 337221248157638853, guid: 9d4ef384d30b05644add2b0f2671172d, type: 3} - propertyPath: m_LocalPosition.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 337221248157638853, guid: 9d4ef384d30b05644add2b0f2671172d, type: 3} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 337221248157638853, guid: 9d4ef384d30b05644add2b0f2671172d, type: 3} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 337221248157638853, guid: 9d4ef384d30b05644add2b0f2671172d, type: 3} - propertyPath: m_LocalRotation.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 337221248157638853, guid: 9d4ef384d30b05644add2b0f2671172d, type: 3} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 337221248157638853, guid: 9d4ef384d30b05644add2b0f2671172d, type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 337221248157638853, guid: 9d4ef384d30b05644add2b0f2671172d, type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 337221248157638853, guid: 9d4ef384d30b05644add2b0f2671172d, type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 2291049519197854382, guid: 9d4ef384d30b05644add2b0f2671172d, type: 3} - propertyPath: m_Layer - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 7977652778530834609, guid: 9d4ef384d30b05644add2b0f2671172d, type: 3} - propertyPath: m_Name - value: Ceiling - objectReference: {fileID: 0} - - target: {fileID: 7977652778530834609, guid: 9d4ef384d30b05644add2b0f2671172d, type: 3} - propertyPath: m_Layer - value: 0 - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_RemovedGameObjects: [] - m_AddedGameObjects: [] - m_AddedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: 9d4ef384d30b05644add2b0f2671172d, type: 3} ---- !u!1 &1990005474 stripped -GameObject: - m_CorrespondingSourceObject: {fileID: 7977652778530834609, guid: 9d4ef384d30b05644add2b0f2671172d, type: 3} - m_PrefabInstance: {fileID: 1990005473} - m_PrefabAsset: {fileID: 0} ---- !u!4 &1990005475 stripped -Transform: - m_CorrespondingSourceObject: {fileID: 337221248157638853, guid: 9d4ef384d30b05644add2b0f2671172d, type: 3} - m_PrefabInstance: {fileID: 1990005473} - m_PrefabAsset: {fileID: 0} --- !u!1001 &1998490651 PrefabInstance: m_ObjectHideFlags: 0 @@ -37627,13 +37859,13 @@ Transform: - {fileID: 317140761} - {fileID: 670779820} - {fileID: 1116054940} + - {fileID: 1081250655} - {fileID: 1036705096} - {fileID: 1909643648} - {fileID: 1694835116} - {fileID: 383472010} - {fileID: 2091700463} - {fileID: 170839271} - - {fileID: 1572417349} - {fileID: 53327395} - {fileID: 1019522717} m_Father: {fileID: 582006396} @@ -39014,6 +39246,10 @@ PrefabInstance: propertyPath: m_Name value: securityCamera_A objectReference: {fileID: 0} + - target: {fileID: 5806765693927249628, guid: 257cf8cd5a8b9fd47a29390c66d54ba9, type: 3} + propertyPath: 'm_Materials.Array.data[0]' + value: + objectReference: {fileID: 2100000, guid: a4126e3e799efbc488e713f4ca63ab49, type: 2} - target: {fileID: 7125524730101362489, guid: 257cf8cd5a8b9fd47a29390c66d54ba9, type: 3} propertyPath: m_LocalPosition.x value: 5.7618446 @@ -39065,6 +39301,7 @@ SceneRoots: m_Roots: - {fileID: 1362233641} - {fileID: 844047824} + - {fileID: 426268210} - {fileID: 348657074} - {fileID: 571851755} - {fileID: 38662619} diff --git a/Assets/Unheimlich_POC/Scenes/DemoOne/Hallucinations Volume Profile.asset b/Assets/Unheimlich_POC/Scenes/DemoOne/Hallucinations Volume Profile.asset new file mode 100644 index 00000000..25e48916 --- /dev/null +++ b/Assets/Unheimlich_POC/Scenes/DemoOne/Hallucinations Volume Profile.asset @@ -0,0 +1,167 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &-8730880457597845575 +MonoBehaviour: + m_ObjectHideFlags: 3 + 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: 0b2db86121404754db890f4c8dfe81b2, type: 3} + m_Name: Bloom + m_EditorClassIdentifier: Unity.RenderPipelines.Universal.Runtime::UnityEngine.Rendering.Universal.Bloom + active: 1 + skipIterations: + m_OverrideState: 0 + m_Value: 1 + threshold: + m_OverrideState: 1 + m_Value: 1 + intensity: + m_OverrideState: 1 + m_Value: 6.07 + scatter: + m_OverrideState: 1 + m_Value: 1 + clamp: + m_OverrideState: 1 + m_Value: 65472 + tint: + m_OverrideState: 1 + m_Value: {r: 0.27672952, g: 0.27672952, b: 0.27672952, a: 1} + highQualityFiltering: + m_OverrideState: 1 + m_Value: 0 + filter: + m_OverrideState: 1 + m_Value: 1 + downscale: + m_OverrideState: 0 + m_Value: 0 + maxIterations: + m_OverrideState: 0 + m_Value: 6 + dirtTexture: + m_OverrideState: 0 + m_Value: {fileID: 0} + dimension: 1 + dirtIntensity: + m_OverrideState: 0 + m_Value: 0 +--- !u!114 &-8301503217428336494 +MonoBehaviour: + m_ObjectHideFlags: 3 + 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: 29fa0085f50d5e54f8144f766051a691, type: 3} + m_Name: FilmGrain + m_EditorClassIdentifier: Unity.RenderPipelines.Universal.Runtime::UnityEngine.Rendering.Universal.FilmGrain + active: 1 + type: + m_OverrideState: 1 + m_Value: 9 + intensity: + m_OverrideState: 1 + m_Value: 1 + response: + m_OverrideState: 1 + m_Value: 0.8 + texture: + m_OverrideState: 0 + m_Value: {fileID: 0} +--- !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: d7fd9488000d3734a9e00ee676215985, type: 3} + m_Name: Hallucinations Volume Profile + m_EditorClassIdentifier: Unity.RenderPipelines.Core.Runtime::UnityEngine.Rendering.VolumeProfile + components: + - {fileID: 5048160815353275902} + - {fileID: 2293496333911105441} + - {fileID: 7109066975785212743} + - {fileID: -8301503217428336494} + - {fileID: -8730880457597845575} +--- !u!114 &2293496333911105441 +MonoBehaviour: + m_ObjectHideFlags: 3 + 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: c5e1dc532bcb41949b58bc4f2abfbb7e, type: 3} + m_Name: LensDistortion + m_EditorClassIdentifier: Unity.RenderPipelines.Universal.Runtime::UnityEngine.Rendering.Universal.LensDistortion + active: 1 + intensity: + m_OverrideState: 1 + m_Value: -0.66 + xMultiplier: + m_OverrideState: 0 + m_Value: 1 + yMultiplier: + m_OverrideState: 0 + m_Value: 1 + center: + m_OverrideState: 0 + m_Value: {x: 0.5, y: 0.5} + scale: + m_OverrideState: 0 + m_Value: 1 +--- !u!114 &5048160815353275902 +MonoBehaviour: + m_ObjectHideFlags: 3 + 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: 81180773991d8724ab7f2d216912b564, type: 3} + m_Name: ChromaticAberration + m_EditorClassIdentifier: Unity.RenderPipelines.Universal.Runtime::UnityEngine.Rendering.Universal.ChromaticAberration + active: 1 + intensity: + m_OverrideState: 1 + m_Value: 1 +--- !u!114 &7109066975785212743 +MonoBehaviour: + m_ObjectHideFlags: 3 + 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: 899c54efeace73346a0a16faa3afe726, type: 3} + m_Name: Vignette + m_EditorClassIdentifier: Unity.RenderPipelines.Universal.Runtime::UnityEngine.Rendering.Universal.Vignette + active: 1 + color: + m_OverrideState: 1 + m_Value: {r: 0, g: 0, b: 0, a: 1} + center: + m_OverrideState: 0 + m_Value: {x: 0.5, y: 0.5} + intensity: + m_OverrideState: 1 + m_Value: 0.14 + smoothness: + m_OverrideState: 1 + m_Value: 0.385 + rounded: + m_OverrideState: 0 + m_Value: 0 diff --git a/Assets/Unheimlich_POC/Scenes/DemoOne/Hallucinations Volume Profile.asset.meta b/Assets/Unheimlich_POC/Scenes/DemoOne/Hallucinations Volume Profile.asset.meta new file mode 100644 index 00000000..60081901 --- /dev/null +++ b/Assets/Unheimlich_POC/Scenes/DemoOne/Hallucinations Volume Profile.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1205a1bec127aa14aa7c48f120b84eb7 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Unheimlich_POC/Scripts/Core/Events/GameEventTrigger.cs b/Assets/Unheimlich_POC/Scripts/Core/Events/GameEventTrigger.cs new file mode 100644 index 00000000..94899b0f --- /dev/null +++ b/Assets/Unheimlich_POC/Scripts/Core/Events/GameEventTrigger.cs @@ -0,0 +1,96 @@ +using UnityEngine; +using UnityEngine.Events; +using System; + +namespace Unheimlich.Core.Events +{ + /// + /// Generic reusable trigger component. Handles the once-flag, optional delay, + /// OnStart/OnEnable auto-fire, and exposes a UnityEvent + C# event for downstream systems. + /// Compose this on any GameObject that needs to fire a game event from multiple sources. + /// + public class GameEventTrigger : MonoBehaviour + { + [Header("Auto-fire")] + [Tooltip("Fire automatically on Start()")] + [SerializeField] private bool _fireOnStart; + + [Tooltip("Fire automatically when this GameObject is enabled")] + [SerializeField] private bool _fireOnEnable; + + [Header("Behaviour")] + [Tooltip("Delay in seconds before the event fires")] + [SerializeField] private float _delay; + + [Tooltip("Prevent this trigger from firing more than once per Play Mode session")] + [SerializeField] private bool _fireOnlyOnce = true; + + [Header("Callbacks")] + [Tooltip("Called when the trigger fires (after the optional delay)")] + [SerializeField] private UnityEvent _onTriggered; + + /// C# event raised when the trigger fires. Useful for code-only listeners. + public event Action OnTriggered; + + private bool _hasFired; + + private bool _startFired; + + private void OnEnable() + { + // Reset per-session so the trigger can fire again when entering Play Mode + // without Domain Reload. + _hasFired = false; + _startFired = false; + + // NOTE: _fireOnEnable is intentionally deferred to Start() so all Singleton + // Awake() calls across the scene complete before listeners access managers. + } + + private void Start() + { + if (_startFired) + return; + + _startFired = true; + + // Fire once even if both flags are ticked + if (_fireOnStart || _fireOnEnable) + Fire(); + } + + /// + /// Fires the trigger. Respects the once-flag and optional delay. + /// Call this from any external script, UnityEvent, or animation event. + /// + public void Fire() + { + if (_fireOnlyOnce && _hasFired) + return; + + if (_delay > 0f) + Invoke(nameof(ExecuteTrigger), _delay); + else + ExecuteTrigger(); + } + + /// + /// Resets the fired state so the trigger can fire again. + /// + public void Reset() + { + _hasFired = false; + CancelInvoke(nameof(ExecuteTrigger)); + } + + private void ExecuteTrigger() + { + if (_fireOnlyOnce && _hasFired) + return; + + _hasFired = true; + _onTriggered?.Invoke(); + OnTriggered?.Invoke(); + } + } +} diff --git a/Assets/Unheimlich_POC/Scripts/Core/Events/GameEventTrigger.cs.meta b/Assets/Unheimlich_POC/Scripts/Core/Events/GameEventTrigger.cs.meta new file mode 100644 index 00000000..4bd2db31 --- /dev/null +++ b/Assets/Unheimlich_POC/Scripts/Core/Events/GameEventTrigger.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 358c75d041ea30a4ab85380893077e70 \ No newline at end of file diff --git a/Assets/Unheimlich_POC/Scripts/Core/Events/TriggerZoneBase.cs b/Assets/Unheimlich_POC/Scripts/Core/Events/TriggerZoneBase.cs new file mode 100644 index 00000000..72f00b34 --- /dev/null +++ b/Assets/Unheimlich_POC/Scripts/Core/Events/TriggerZoneBase.cs @@ -0,0 +1,87 @@ +using UnityEngine; +using System; + +namespace Unheimlich.Core.Events +{ + /// + /// Abstract base for any physics-trigger zone that fires when the player enters. + /// Handles collider validation, player tag check, once-flag, retrigger, and Gizmos. + /// Subclasses implement OnPlayerEntered() and optionally OnPlayerExited(). + /// + [RequireComponent(typeof(Collider))] + public abstract class TriggerZoneBase : MonoBehaviour + { + [Header("Zone Settings")] + [SerializeField] private string _playerTag = "Player"; + + [Header("Gizmo")] + [SerializeField] private Color _gizmoColor = new Color(0.8f, 0.5f, 0.0f, 0.35f); + + protected bool HasFired { get; private set; } + + private Collider _collider; + + /// + /// Override to control whether the zone can fire again after the first trigger. + /// Default is false (fires once). Subclasses expose their own retrigger field and return it here. + /// + protected virtual bool IsRetriggerable => false; + + protected virtual void Awake() + { + _collider = GetComponent(); + + if (!_collider.isTrigger) + { + Debug.LogWarning($"[{GetType().Name}] Collider on '{gameObject.name}' is not a trigger. Forcing it.", this); + _collider.isTrigger = true; + } + } + + private void OnTriggerEnter(Collider other) + { + if (!other.CompareTag(_playerTag)) + return; + + if (HasFired && !IsRetriggerable) + return; + + HasFired = true; + OnPlayerEntered(other); + } + + private void OnTriggerExit(Collider other) + { + if (!other.CompareTag(_playerTag)) + return; + + OnPlayerExited(other); + } + + /// Called when the player enters the trigger zone. + protected abstract void OnPlayerEntered(Collider playerCollider); + + /// Called when the player exits the trigger zone. Override if needed. + protected virtual void OnPlayerExited(Collider playerCollider) { } + + /// Resets the fired state so the zone can fire again. + public void ResetZone() + { + HasFired = false; + } + + private void OnDrawGizmosSelected() + { + Gizmos.color = _gizmoColor; + Gizmos.matrix = transform.localToWorldMatrix; + + Collider col = GetComponent(); + if (col is BoxCollider box) + Gizmos.DrawCube(box.center, box.size); + else if (col is SphereCollider sphere) + Gizmos.DrawSphere(sphere.center, sphere.radius); + else if (col is CapsuleCollider capsule) + Gizmos.DrawWireSphere(capsule.center, capsule.radius); + } + } +} diff --git a/Assets/Unheimlich_POC/Scripts/Core/Events/TriggerZoneBase.cs.meta b/Assets/Unheimlich_POC/Scripts/Core/Events/TriggerZoneBase.cs.meta new file mode 100644 index 00000000..b8c35876 --- /dev/null +++ b/Assets/Unheimlich_POC/Scripts/Core/Events/TriggerZoneBase.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 9fae9f4c26344344e93baeaee0281284 \ No newline at end of file diff --git a/Assets/Unheimlich_POC/Scripts/Core/Interaction/ObjectDescriptionTrigger.cs b/Assets/Unheimlich_POC/Scripts/Core/Interaction/ObjectDescriptionTrigger.cs index d0db3bd9..848797e7 100644 --- a/Assets/Unheimlich_POC/Scripts/Core/Interaction/ObjectDescriptionTrigger.cs +++ b/Assets/Unheimlich_POC/Scripts/Core/Interaction/ObjectDescriptionTrigger.cs @@ -41,6 +41,9 @@ namespace Unheimlich.Core.Interaction private bool _isActive = false; private bool _isMerged = false; private bool _hasBeenMergedOnce = false; + + // Persists across OnEnable/OnDisable — only cleared by explicit ResetMerge() + // or at the start of a new Play Mode session via RuntimeInitializeOnLoadMethod. private bool _hasCompletedMergeOnce = false; private Vector3[] _originalSpawnPositions; private Vector3[] _basePositions; @@ -51,21 +54,69 @@ namespace Unheimlich.Core.Interaction void Start() { - _playerTransform = PlayerController.Instance.transform; + InitializeReferences(); + } + + void OnEnable() + { + // With Scene Reload disabled, Start() doesn't run again between Play Mode sessions. + // Re-fetch references and reset transient state so animations restart cleanly. + InitializeReferences(); + ResetSessionState(); + } + + private void InitializeReferences() + { + _playerTransform = PlayerController.Instance != null ? PlayerController.Instance.transform : null; _mainCamera = Camera.main; - + if (_playerTransform == null) Debug.LogWarning($"[ObjectDescription] No player found for {gameObject.name}"); - + if (_descriptionAnchor == null) _descriptionAnchor = transform; - + if (_settings == null) { Debug.LogError($"[ObjectDescription] No settings assigned for {gameObject.name}"); enabled = false; } } + + private void ResetSessionState() + { + // Force-despawn any leftover words from the previous session + // (their GOs were destroyed but _spawnedWords list may still have stale entries). + if (_isActive) + { + foreach (var word in _spawnedWords) + { + if (word != null) Destroy(word.gameObject); + } + _spawnedWords.Clear(); + + if (_wordsContainer != null) Destroy(_wordsContainer); + _wordsContainer = null; + _wordsRotator = null; + } + + _isActive = false; + _isMerged = false; + _hasBeenMergedOnce = false; + // _hasCompletedMergeOnce intentionally NOT reset here — persists during session + // so a merged object stays merged when the player re-enters its activation range. + // It is only reset at the start of a new Play Mode session (see OnPlayModeReset). + _currentConvergenceRadius = 0f; + } + + // Resets _hasCompletedMergeOnce at the very start of each Play Mode session, + // before any scene loads, so objects start fresh without full Domain Reload. + [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)] + private static void OnPlayModeReset() + { + // Static reset — instance fields will be re-initialized by Awake/Start naturally. + // No instance access needed here; ResetSessionState() handles the rest on OnEnable. + } void Update() { diff --git a/Assets/Unheimlich_POC/Scripts/Core/Managers/Singleton.cs b/Assets/Unheimlich_POC/Scripts/Core/Managers/Singleton.cs index 00d01af1..157317c1 100644 --- a/Assets/Unheimlich_POC/Scripts/Core/Managers/Singleton.cs +++ b/Assets/Unheimlich_POC/Scripts/Core/Managers/Singleton.cs @@ -1,23 +1,62 @@ using UnityEngine; +using System; +using System.Collections.Generic; namespace Unheimlich.Core { + /// + /// Clears all Singleton static instances at the start of every Play Mode session. + /// Necessary when Domain Reload is disabled in Enter Play Mode settings. + /// + internal static class SingletonRegistry + { + private static readonly List _resetCallbacks = new List(); + + public static void Register(Action resetCallback) + { + if (!_resetCallbacks.Contains(resetCallback)) + _resetCallbacks.Add(resetCallback); + } + + [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)] + private static void ResetAll() + { + foreach (Action reset in _resetCallbacks) + reset?.Invoke(); + } + } + public abstract class Singleton : MonoBehaviour where T : MonoBehaviour { public static T Instance { get; private set; } - + + static Singleton() + { + SingletonRegistry.Register(() => Instance = null); + } + protected virtual void Awake() { if (Instance != null && Instance != this) { - Debug.LogWarning($"[{typeof(T).Name}] Multiple instances detected! Destroying duplicate on GameObject '{gameObject.name}'."); + Debug.LogWarning($"[{typeof(T).Name}] Multiple instances detected! Destroying duplicate on '{gameObject.name}'."); Destroy(this); return; } Instance = this as T; OnAwake(); } - + + // Re-registers the instance when entering Play Mode with Scene Reload disabled. + // SubsystemRegistration clears Instance before OnEnable runs, so we restore it here. + protected virtual void OnEnable() + { + if (Instance == null) + Instance = this as T; + + OnEnabled(); + } + protected virtual void OnDestroy() { if (Instance == this) @@ -26,8 +65,9 @@ namespace Unheimlich.Core OnDestroyInstance(); } } - + protected virtual void OnAwake() { } + protected virtual void OnEnabled() { } protected virtual void OnDestroyInstance() { } } } diff --git a/Assets/Unheimlich_POC/Scripts/Core/Utils/GameSessionResetter.cs b/Assets/Unheimlich_POC/Scripts/Core/Utils/GameSessionResetter.cs new file mode 100644 index 00000000..730b3559 --- /dev/null +++ b/Assets/Unheimlich_POC/Scripts/Core/Utils/GameSessionResetter.cs @@ -0,0 +1,25 @@ +using UnityEngine; + +namespace Unheimlich.Core.Utils +{ + /// + /// Resets third-party static state that doesn't handle Domain Reload being disabled. + /// Runs automatically at the start of every Play Mode session before the scene loads. + /// + internal static class GameSessionResetter + { + [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)] + private static void OnSessionStart() + { + ResetLeanTween(); + } + + private static void ResetLeanTween() + { + // LeanTween holds a static tween array that persists when Domain Reload is disabled. + // Stale tween IDs from the previous session cause callbacks to fire on wrong objects, + // which breaks animations like organic shake on floating words. + LeanTween.reset(); + } + } +} diff --git a/Assets/Unheimlich_POC/Scripts/Core/Utils/GameSessionResetter.cs.meta b/Assets/Unheimlich_POC/Scripts/Core/Utils/GameSessionResetter.cs.meta new file mode 100644 index 00000000..73d3439a --- /dev/null +++ b/Assets/Unheimlich_POC/Scripts/Core/Utils/GameSessionResetter.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 34edfe05577b2a24892a90d9901cef39 \ No newline at end of file diff --git a/Assets/Unheimlich_POC/Scripts/Features/DetectiveBoard/Runtime/ClueUnlockTrigger.cs b/Assets/Unheimlich_POC/Scripts/Features/DetectiveBoard/Runtime/ClueUnlockTrigger.cs index d3215eea..c0380cca 100644 --- a/Assets/Unheimlich_POC/Scripts/Features/DetectiveBoard/Runtime/ClueUnlockTrigger.cs +++ b/Assets/Unheimlich_POC/Scripts/Features/DetectiveBoard/Runtime/ClueUnlockTrigger.cs @@ -1,105 +1,98 @@ using UnityEngine; +using Unheimlich.Core.Events; using Unheimlich.Features.DetectiveBoard.Data; -using Unheimlich.Features.DetectiveBoard; namespace Unheimlich.Features.DetectiveBoard { /// - /// Generic trigger to unlock clues on the detective board. - /// Can be triggered by any game event: dialogue, object interaction, audio cue, hallucination, etc. - /// Simply call UnlockClue() when the trigger condition is met. + /// Unlocks a clue on the detective board. + /// Can be driven by an optional GameEventTrigger on the same GameObject, + /// or called directly via UnlockClue() from any external script or UnityEvent. /// public class ClueUnlockTrigger : MonoBehaviour { [Header("Clue Configuration")] [Tooltip("The clue data to unlock when triggered")] [SerializeField] private ClueData _clueToUnlock; - - [Header("Trigger Settings")] - [Tooltip("Automatically unlock on Start()")] + + [Header("Auto Trigger")] + [Tooltip("Unlock automatically on Start()")] [SerializeField] private bool _unlockOnStart; - - [Tooltip("Unlock when this GameObject is enabled")] - [SerializeField] private bool _unlockOnEnable; - - [Tooltip("Delay before unlocking (useful for sequencing)")] + + [Tooltip("Delay in seconds before unlocking (only with Unlock On Start)")] [SerializeField] private float _unlockDelay; - - [Tooltip("Show debug messages")] + + [Tooltip("Prevent unlocking more than once")] + [SerializeField] private bool _unlockOnlyOnce = true; + + [Header("Debug")] [SerializeField] private bool _debugMode; - + + private GameEventTrigger _eventTrigger; private bool _hasUnlocked; - + + /// Raised after the clue has been successfully unlocked. + public event System.Action OnClueUnlocked; + + private void Awake() + { + // Optional composition with GameEventTrigger + _eventTrigger = GetComponent(); + if (_eventTrigger != null) + _eventTrigger.OnTriggered += UnlockClue; + } + private void Start() { if (_unlockOnStart) { - UnlockClue(); + if (_unlockDelay > 0f) + Invoke(nameof(UnlockClue), _unlockDelay); + else + UnlockClue(); } } - - private void OnEnable() + + private void OnDestroy() { - if (_unlockOnEnable && !_hasUnlocked) - { - UnlockClue(); - } + if (_eventTrigger != null) + _eventTrigger.OnTriggered -= UnlockClue; } - + /// - /// Unlocks the associated clue. Can be called from external scripts, events, or animations. + /// Unlocks the associated clue. Can be called directly from external scripts or UnityEvents. /// public void UnlockClue() { - if (_hasUnlocked) - { - if (_debugMode) - Debug.LogWarning($"[ClueUnlockTrigger] Clue '{_clueToUnlock?.Title}' already unlocked!"); + if (_unlockOnlyOnce && _hasUnlocked) return; - } - + if (_clueToUnlock == null) { - Debug.LogError("[ClueUnlockTrigger] No clue data assigned!"); + Debug.LogError("[ClueUnlockTrigger] No clue data assigned!", this); return; } - - if (_unlockDelay > 0f) + + if (DetectiveBoardManager.Instance == null) { - Invoke(nameof(UnlockClueImmediate), _unlockDelay); - } - else - { - UnlockClueImmediate(); + Debug.LogError("[ClueUnlockTrigger] DetectiveBoardManager not found!", this); + return; } + + DetectiveBoardManager.Instance.UnlockClue(_clueToUnlock); + _hasUnlocked = true; + + if (_debugMode) + Debug.Log($"[ClueUnlockTrigger] Unlocked clue: {_clueToUnlock.Title}", this); + + OnClueUnlocked?.Invoke(); } - - private void UnlockClueImmediate() - { - if (DetectiveBoardManager.Instance != null) - { - DetectiveBoardManager.Instance.UnlockClue(_clueToUnlock); - _hasUnlocked = true; - - if (_debugMode) - Debug.Log($"[ClueUnlockTrigger] Unlocked clue: {_clueToUnlock.Title}"); - - OnClueUnlocked?.Invoke(); - } - else - { - Debug.LogError("[ClueUnlockTrigger] DetectiveBoardManager not found!"); - } - } - - /// - /// Resets the unlock state (useful for testing). - /// + + /// Resets the unlock state so the clue can be unlocked again. public void ResetUnlock() { _hasUnlocked = false; + CancelInvoke(nameof(UnlockClue)); } - - public event System.Action OnClueUnlocked; } } diff --git a/Assets/Unheimlich_POC/Scripts/Features/DetectiveBoard/Runtime/DetectiveBoardController.cs b/Assets/Unheimlich_POC/Scripts/Features/DetectiveBoard/Runtime/DetectiveBoardController.cs index 6d3a48e9..d2bcbab5 100644 --- a/Assets/Unheimlich_POC/Scripts/Features/DetectiveBoard/Runtime/DetectiveBoardController.cs +++ b/Assets/Unheimlich_POC/Scripts/Features/DetectiveBoard/Runtime/DetectiveBoardController.cs @@ -138,6 +138,10 @@ namespace Unheimlich.Features.DetectiveBoard DetectiveBoardCanvas.Instance.BoardRenderer ); + // Show clue hand fan when board is ready + if (ClueHandUI.Instance != null) + ClueHandUI.Instance.SetHandVisible(true); + if (_playerAlignmentSettings != null) cameraPan.Settings = originalSettings; }); @@ -159,6 +163,10 @@ namespace Unheimlich.Features.DetectiveBoard _isBoardActive = false; + // Hide clue hand fan + if (ClueHandUI.Instance != null) + ClueHandUI.Instance.SetHandVisible(false); + DetectiveBoardVirtualCamera.Instance.Deactivate(() => { var cameraPan = PlayerController.Instance?.CameraPanController; diff --git a/Assets/Unheimlich_POC/Scripts/Features/DetectiveBoard/UI/ClueHandCard.cs b/Assets/Unheimlich_POC/Scripts/Features/DetectiveBoard/UI/ClueHandCard.cs new file mode 100644 index 00000000..1d894607 --- /dev/null +++ b/Assets/Unheimlich_POC/Scripts/Features/DetectiveBoard/UI/ClueHandCard.cs @@ -0,0 +1,122 @@ +using UnityEngine; +using UnityEngine.EventSystems; +using Unheimlich.Features.DetectiveBoard.Data; + +namespace Unheimlich.Features.DetectiveBoard.UI +{ + /// + /// Wraps a PostItNode to behave as a card in the bottom-screen fan hand. + /// Handles hover pop animation and delegates click to ClueHandUI for board placement. + /// Add this component alongside PostItNode on the same GameObject. + /// + [RequireComponent(typeof(PostItNode))] + public class ClueHandCard : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler, IPointerClickHandler + { + [Header("Hover Settings")] + [SerializeField] private float _hoverRiseAmount = 60f; + [SerializeField] private float _hoverAnimSpeed = 8f; + + private PostItNode _node; + private ClueHandUI _handUI; + + // Fan resting state assigned by ClueHandUI + private Vector2 _restAnchoredPosition; + private float _restRotation; + + // Runtime animation state + private Vector2 _currentAnchoredPosition; + private float _currentRotation; + private bool _isHovered; + private bool _isPlaced; + + public ClueData ClueData => _node != null ? _node.ClueData : null; + public PostItNode Node => _node; + public bool IsPlaced => _isPlaced; + + private void Awake() + { + if (_node == null) + _node = GetComponent(); + } + + /// + /// Binds this card to its parent hand manager. + /// + public void Initialize(PostItNode node, ClueHandUI handUI) + { + _node = node; + _handUI = handUI; + } + + /// + /// Assigns the resting fan slot (position + rotation) for this card. + /// + public void SetFanSlot(Vector2 anchoredPosition, float rotationZ) + { + _restAnchoredPosition = anchoredPosition; + _restRotation = rotationZ; + _currentAnchoredPosition = anchoredPosition; + _currentRotation = rotationZ; + + RectTransform rt = _node.RectTransform; + rt.anchoredPosition = anchoredPosition; + rt.localRotation = Quaternion.Euler(0f, 0f, rotationZ); + } + + private void Update() + { + if (_isPlaced) + return; + + RectTransform rt = _node.RectTransform; + + Vector2 targetPos = _isHovered + ? _restAnchoredPosition + Vector2.up * _hoverRiseAmount + : _restAnchoredPosition; + + float targetRot = _isHovered ? 0f : _restRotation; + + _currentAnchoredPosition = Vector2.Lerp(_currentAnchoredPosition, targetPos, Time.deltaTime * _hoverAnimSpeed); + _currentRotation = Mathf.LerpAngle(_currentRotation, targetRot, Time.deltaTime * _hoverAnimSpeed); + + rt.anchoredPosition = _currentAnchoredPosition; + rt.localRotation = Quaternion.Euler(0f, 0f, _currentRotation); + } + + public void OnPointerEnter(PointerEventData eventData) + { + if (_isPlaced) + return; + + _isHovered = true; + _handUI?.OnCardHovered(this); + } + + public void OnPointerExit(PointerEventData eventData) + { + if (_isPlaced) + return; + + _isHovered = false; + _handUI?.OnCardUnhovered(this); + } + + public void OnPointerClick(PointerEventData eventData) + { + if (_isPlaced || eventData.button != PointerEventData.InputButton.Left) + return; + + _isHovered = false; + _handUI?.OnCardSelected(this); + } + + /// + /// Hides this card from the hand after placement on the board. + /// + public void MarkAsPlaced() + { + _isPlaced = true; + gameObject.SetActive(false); + } + } +} diff --git a/Assets/Unheimlich_POC/Scripts/Features/DetectiveBoard/UI/ClueHandCard.cs.meta b/Assets/Unheimlich_POC/Scripts/Features/DetectiveBoard/UI/ClueHandCard.cs.meta new file mode 100644 index 00000000..d7fed6e7 --- /dev/null +++ b/Assets/Unheimlich_POC/Scripts/Features/DetectiveBoard/UI/ClueHandCard.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: dc7ce79e8bf16554fae5362980fec5b7 \ No newline at end of file diff --git a/Assets/Unheimlich_POC/Scripts/Features/DetectiveBoard/UI/ClueHandUI.cs b/Assets/Unheimlich_POC/Scripts/Features/DetectiveBoard/UI/ClueHandUI.cs new file mode 100644 index 00000000..753fb23d --- /dev/null +++ b/Assets/Unheimlich_POC/Scripts/Features/DetectiveBoard/UI/ClueHandUI.cs @@ -0,0 +1,252 @@ +using UnityEngine; +using System.Collections.Generic; +using Unheimlich.Core; +using Unheimlich.Features.DetectiveBoard.Data; + +namespace Unheimlich.Features.DetectiveBoard.UI +{ + /// + /// Manages the clue hand fan displayed at the bottom of the screen (Screen Space canvas). + /// Reuses the PostItNode prefab for each card — ClueHandCard is added at runtime. + /// Hovering a card pops it up and straightens it; clicking starts a lerp-depth + /// placement animation then hands the clue to DetectiveBoardCanvas. + /// + public class ClueHandUI : Singleton + { + [Header("References")] + [SerializeField] private GameObject _postItNodePrefab; + [SerializeField] private RectTransform _handContainer; + + [Header("Fan Layout Settings")] + [SerializeField] private float _cardSpacingPixels = 80f; + [SerializeField] private float _fanArcRadius = 800f; + [SerializeField] private float _cardBaseY = -120f; + [SerializeField] private float _maxFanHalfAngle = 40f; + + [Header("Placement Settings")] + [SerializeField] private float _placementLerpSpeed = 5f; + + private readonly List _handCards = new List(); + private bool _isPlacing; protected override void OnAwake() { } + + protected override void OnEnabled() + { + // With Scene Reload disabled, stale card references from the previous session + // may point to destroyed GameObjects. Clear and rebuild from manager state. + if (_handCards.Count > 0) + { + foreach (ClueHandCard card in _handCards) + { + if (card != null && card.gameObject != null) + Destroy(card.gameObject); + } + _handCards.Clear(); + } + + if (DetectiveBoardManager.Instance != null) + { + foreach (var clue in DetectiveBoardManager.Instance.GetUnlockedClues()) + { + // Skip clues already placed on the board — they must not reappear in the hand + if (DetectiveBoardCanvas.Instance != null && DetectiveBoardCanvas.Instance.HasNodeForClue(clue.ClueID)) + continue; + + AddClueCard(clue); + } + } + } + + private void Start() + { + if (DetectiveBoardManager.Instance != null) + { + DetectiveBoardManager.Instance.OnClueUnlocked += OnClueUnlocked; + + foreach (var clue in DetectiveBoardManager.Instance.GetUnlockedClues()) + AddClueCard(clue); + } + + // Start hidden — shown when the board activates + SetHandVisible(false); + } + + private void OnDestroy() + { + if (DetectiveBoardManager.Instance != null) + DetectiveBoardManager.Instance.OnClueUnlocked -= OnClueUnlocked; + } + + private void OnClueUnlocked(ClueData clueData) + { + AddClueCard(clueData); + } + + // ────────────────────────────────────────────────────────────────────── + // Card management + // ────────────────────────────────────────────────────────────────────── + + /// + /// Instantiates a PostItNode prefab, injects ClueHandCard, and adds it to the fan. + /// + public void AddClueCard(ClueData clueData) + { + if (_postItNodePrefab == null || _handContainer == null) + { + Debug.LogError("[ClueHandUI] Missing _postItNodePrefab or _handContainer reference."); + return; + } + + if (_handCards.Exists(c => c.ClueData != null && c.ClueData.ClueID == clueData.ClueID)) + return; + + // Instantiate the PostItNode prefab inside the screen-space hand container + GameObject cardObj = Instantiate(_postItNodePrefab, _handContainer); + + // PostItNode is nested one level inside "Canvas (Environment)" wrapper in the prefab + // — grab it directly + PostItNode node = cardObj.GetComponentInChildren(true); + if (node == null) + { + Debug.LogError("[ClueHandUI] PostItNode not found on prefab."); + Destroy(cardObj); + return; + } + + // Create a dummy NodeData for the hand display (position handled by fan layout) + PostItNodeData dummyData = new PostItNodeData(clueData.ClueID, Vector2.zero); + node.Initialize(clueData, dummyData); + + // Add ClueHandCard wrapper on the PostItNode GameObject + ClueHandCard card = node.gameObject.AddComponent(); + card.Initialize(node, this); + + // Move the PostItNode GameObject up to be a direct child of _handContainer + // so its RectTransform is in screen space + node.transform.SetParent(_handContainer, false); + + // Destroy the now-empty prefab root (the "Canvas (Environment)" wrapper) + if (cardObj != node.gameObject) + Destroy(cardObj); + + // Normalize scale — PostItNode prefab uses 0.5 scale for world space, reset for screen space + node.RectTransform.localScale = Vector3.one; + + _handCards.Add(card); + RebuildFanLayout(); + } + + /// + /// Recomputes fan arc positions and rotations for all non-placed cards. + /// Uses fixed pixel spacing between cards, capped by a max half-angle. + /// + private void RebuildFanLayout() + { + List visible = _handCards.FindAll(c => !c.IsPlaced); + int count = visible.Count; + + if (count == 0) + return; + + // Derive the angle step from pixel spacing on the arc + float angleStepDeg = (_cardSpacingPixels / _fanArcRadius) * Mathf.Rad2Deg; + + // Total spread is (count-1) steps, capped so it never exceeds _maxFanHalfAngle on each side + float totalHalfAngle = angleStepDeg * (count - 1) * 0.5f; + float clampedHalfAngle = Mathf.Min(totalHalfAngle, _maxFanHalfAngle); + + for (int i = 0; i < count; i++) + { + float t = count == 1 ? 0.5f : (float)i / (count - 1); + float angle = Mathf.Lerp(-clampedHalfAngle, clampedHalfAngle, t); + float angleRad = angle * Mathf.Deg2Rad; + + float x = _fanArcRadius * Mathf.Sin(angleRad); + float y = _cardBaseY - _fanArcRadius * (1f - Mathf.Cos(angleRad)); + + visible[i].SetFanSlot(new Vector2(x, y), -angle); + } + } + + // ────────────────────────────────────────────────────────────────────── + // Hover callbacks + // ────────────────────────────────────────────────────────────────────── + + /// Brings the hovered card in front of its siblings. + public void OnCardHovered(ClueHandCard card) + { + card.transform.SetAsLastSibling(); + } + + /// Restores natural sibling order after hover ends. + public void OnCardUnhovered(ClueHandCard card) + { + RebuildSiblingOrder(); + } + + private void RebuildSiblingOrder() + { + int index = 0; + foreach (ClueHandCard c in _handCards) + { + if (!c.IsPlaced) + c.transform.SetSiblingIndex(index++); + } + } + + // ────────────────────────────────────────────────────────────────────── + // Selection & placement + // ────────────────────────────────────────────────────────────────────── + + /// + /// Called when the player clicks a card. Creates the node on the board + /// directly under the mouse cursor and immediately starts drag mode. + /// + public void OnCardSelected(ClueHandCard card) + { + if (_isPlacing) + return; + + DetectiveBoardCanvas boardCanvas = DetectiveBoardCanvas.Instance; + if (boardCanvas == null) + { + Debug.LogWarning("[ClueHandUI] DetectiveBoardCanvas not found."); + return; + } + + DetectiveBoardInteraction interaction = DetectiveBoardInteraction.Instance; + if (interaction == null) + { + Debug.LogWarning("[ClueHandUI] DetectiveBoardInteraction not found."); + return; + } + + boardCanvas.AddClueNode(card.ClueData); + + PostItNode boardNode = boardCanvas.GetNodeForClue(card.ClueData.ClueID); + if (boardNode == null) + { + Debug.LogWarning("[ClueHandUI] Node not found on board after AddClueNode."); + return; + } + + // Position node under the mouse on the board canvas plane, then start drag + interaction.SpawnNodeUnderMouseAndDrag(boardNode); + + card.MarkAsPlaced(); + RebuildFanLayout(); + } + + // ────────────────────────────────────────────────────────────────────── + // Visibility + // ────────────────────────────────────────────────────────────────────── + + /// + /// Shows or hides the fan hand. Called by DetectiveBoardController. + /// + public void SetHandVisible(bool visible) + { + if (_handContainer != null) + _handContainer.gameObject.SetActive(visible); + } + } +} diff --git a/Assets/Unheimlich_POC/Scripts/Features/DetectiveBoard/UI/ClueHandUI.cs.meta b/Assets/Unheimlich_POC/Scripts/Features/DetectiveBoard/UI/ClueHandUI.cs.meta new file mode 100644 index 00000000..b6f4f247 --- /dev/null +++ b/Assets/Unheimlich_POC/Scripts/Features/DetectiveBoard/UI/ClueHandUI.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: ace0b6173dad68f47a97505680f54d4e \ No newline at end of file diff --git a/Assets/Unheimlich_POC/Scripts/Features/DetectiveBoard/UI/DetectiveBoardCanvas.cs b/Assets/Unheimlich_POC/Scripts/Features/DetectiveBoard/UI/DetectiveBoardCanvas.cs index fbe74a1f..fb3ab306 100644 --- a/Assets/Unheimlich_POC/Scripts/Features/DetectiveBoard/UI/DetectiveBoardCanvas.cs +++ b/Assets/Unheimlich_POC/Scripts/Features/DetectiveBoard/UI/DetectiveBoardCanvas.cs @@ -131,45 +131,11 @@ namespace Unheimlich.Features.DetectiveBoard.UI _saveData = new DetectiveBoardSaveData(); } - private void OnEnable() - { - TrySubscribeToManager(); - } - - private void Start() - { - TrySubscribeToManager(); - } - - private void TrySubscribeToManager() - { - if (DetectiveBoardManager.Instance != null) - { - DetectiveBoardManager.Instance.OnClueUnlocked -= OnClueUnlocked; - DetectiveBoardManager.Instance.OnClueUnlocked += OnClueUnlocked; - - foreach (var clue in DetectiveBoardManager.Instance.GetUnlockedClues()) - { - if (!_activeNodes.ContainsKey(clue.ClueID)) - { - AddClueNode(clue); - } - } - } - } - - private void OnDisable() - { - if (DetectiveBoardManager.Instance != null) - { - DetectiveBoardManager.Instance.OnClueUnlocked -= OnClueUnlocked; - } - } - - private void OnClueUnlocked(ClueData clueData) - { - AddClueNode(clueData); - } + private void OnEnable() { } + + private void Start() { } + + private void OnDisable() { } private void Update() { @@ -413,6 +379,19 @@ namespace Unheimlich.Features.DetectiveBoard.UI } } + /// + /// Returns the active PostItNode for the given clue ID, or null if not found. + /// Used by ClueHandUI to retrieve the node after placement. + /// + /// Returns true if a node for this clue ID is already placed on the board. + public bool HasNodeForClue(string clueID) => _activeNodes.ContainsKey(clueID); + + public PostItNode GetNodeForClue(string clueID) + { + _activeNodes.TryGetValue(clueID, out PostItNode node); + return node; + } + public DetectiveBoardSaveData GetSaveData() { return _saveData; diff --git a/Assets/Unheimlich_POC/Scripts/Features/DetectiveBoard/UI/DetectiveBoardInteraction.cs b/Assets/Unheimlich_POC/Scripts/Features/DetectiveBoard/UI/DetectiveBoardInteraction.cs index 9ec77521..710837d7 100644 --- a/Assets/Unheimlich_POC/Scripts/Features/DetectiveBoard/UI/DetectiveBoardInteraction.cs +++ b/Assets/Unheimlich_POC/Scripts/Features/DetectiveBoard/UI/DetectiveBoardInteraction.cs @@ -1,6 +1,7 @@ using UnityEngine; using UnityEngine.InputSystem; using UnityEngine.UI; +using Unheimlich.Core; using Unheimlich.Features.DetectiveBoard; using Unheimlich.Features.Player; using Unheimlich.World.CameraSystem; @@ -14,7 +15,7 @@ namespace Unheimlich.Features.DetectiveBoard.UI /// Manages hover, selection, dragging, and click forwarding for Post-It nodes. /// Interactions are only active when the board is in inspection mode. /// - public class DetectiveBoardInteraction : MonoBehaviour + public class DetectiveBoardInteraction : Singleton { [Header("Settings")] [SerializeField] private LayerMask _boardLayer; @@ -33,6 +34,8 @@ namespace Unheimlich.Features.DetectiveBoard.UI private Plane _canvasPlane; private Vector3 _dragOffset; + protected override void OnAwake() { } + private void Start() { _boardCanvas = GetComponent(); @@ -349,6 +352,41 @@ namespace Unheimlich.Features.DetectiveBoard.UI } } + /// + /// Positions a freshly-created board node under the current mouse cursor + /// and immediately enters drag mode on it, so the player can place it freely. + /// Called by ClueHandUI after AddClueNode. + /// + public void SpawnNodeUnderMouseAndDrag(PostItNode node) + { + if (node == null || _camera == null) + return; + + UpdateCanvasPlane(); + + Vector2 mousePos = Mouse.current != null + ? Mouse.current.position.ReadValue() + : new Vector2(Screen.width * 0.5f, Screen.height * 0.5f); + + Ray ray = _camera.ScreenPointToRay(new Vector3(mousePos.x, mousePos.y, 0f)); + + if (_canvasPlane.Raycast(ray, out float enter)) + { + Vector3 worldHitPoint = ray.GetPoint(enter); + Vector3 localPos = _boardCanvas.transform.InverseTransformPoint(worldHitPoint); + node.SetPosition(new Vector2(localPos.x, localPos.y)); + } + + // Begin drag with zero offset so the node centre tracks the mouse exactly + if (_selectedNode != null) + _selectedNode.SetSelected(false); + + _selectedNode = node; + _selectedNode.SetSelected(true); + _isDragging = true; + _dragOffset = Vector3.zero; + } + private PostItNode RaycastForNode() { if (_camera == null || Mouse.current == null) diff --git a/Assets/Unheimlich_POC/Scripts/Features/Dialogue/Runtime/DialogueManager.cs b/Assets/Unheimlich_POC/Scripts/Features/Dialogue/Runtime/DialogueManager.cs index edf6937e..d5ca26bb 100644 --- a/Assets/Unheimlich_POC/Scripts/Features/Dialogue/Runtime/DialogueManager.cs +++ b/Assets/Unheimlich_POC/Scripts/Features/Dialogue/Runtime/DialogueManager.cs @@ -53,8 +53,35 @@ namespace Unheimlich.Features.Dialogue private float _autoCloseTimer = 0f; private bool _isWaitingForAutoClose = false; - protected override void OnAwake() + protected override void OnAwake() { } + + protected override void OnEnabled() { + // With Scene Reload disabled, Start() doesn't run again each session. + // We recreate the focus system to clear any stale locked state (_isFocusLocked, + // _focusTimer, _currentFocusedHandler) that may have carried over. + if (_focusSystem != null) + { + _mainCamera = Camera.main; + _focusSystem = new DialogueFocusSystem( + this, + _mainCamera, + PlayerController.Instance?.CameraEffects, + _choiceLayer, + _focusRange, + _focusTime, + _raycastInterval, + _recoveryDuration, + _focusRetentionTime, + _fallbackShakeIntensity + ); + _focusSystem.OnChoiceMade += (choice) => OnChoiceMade?.Invoke(choice); + + // Also reset dialogue state in case we exited mid-dialogue + IsInDialogue = false; + _isWaitingForAutoClose = false; + _autoCloseTimer = 0f; + } } private void Start() @@ -82,6 +109,13 @@ namespace Unheimlich.Features.Dialogue if (!IsInDialogue) return; + if (_activeDialogueUI == null) + { + Debug.LogError("[DialogueManager] IsInDialogue is true but _activeDialogueUI is null. Forcing dialogue end.", this); + IsInDialogue = false; + return; + } + if (!_activeDialogueUI.AreChoicesVisible()) { if (_isWaitingForAutoClose && _currentNode != null && _currentNode.AutoCloseDelay > 0f) @@ -142,6 +176,12 @@ namespace Unheimlich.Features.Dialogue _activeDialogueUI = customDialogueUI; CurrentOwner = owner; + if (_activeDialogueUI == null) + { + Debug.LogError("[DialogueManager] StartConversation called with no DialogueUI. Assign a Local Dialogue UI on the DialogueTriggerZone that triggered this conversation.", this); + return; + } + ShowCurrentNode(); } diff --git a/Assets/Unheimlich_POC/Scripts/Features/Dialogue/Runtime/DialogueTriggerZone.cs b/Assets/Unheimlich_POC/Scripts/Features/Dialogue/Runtime/DialogueTriggerZone.cs index b246a64e..74fdcab6 100644 --- a/Assets/Unheimlich_POC/Scripts/Features/Dialogue/Runtime/DialogueTriggerZone.cs +++ b/Assets/Unheimlich_POC/Scripts/Features/Dialogue/Runtime/DialogueTriggerZone.cs @@ -2,6 +2,7 @@ using UnityEngine; using Unheimlich.Features.Dialogue.Data; using Unheimlich.Features.Dialogue; using Unheimlich.Features.Dialogue.UI; +using Unheimlich.Core.Events; namespace Unheimlich.Features.Dialogue { @@ -9,9 +10,8 @@ namespace Unheimlich.Features.Dialogue /// Trigger zone that starts a dialogue sequence when player enters. /// Supports pause/resume on exit/enter and optional one-time triggering. /// - [RequireComponent(typeof(Collider))] - public class DialogueTriggerZone : MonoBehaviour -{ + public class DialogueTriggerZone : TriggerZoneBase + { [Header("Dialogue Reference")] [Tooltip("DialogueConversation to use for this trigger zone")] [SerializeField] private DialogueConversation _conversation; @@ -19,8 +19,8 @@ namespace Unheimlich.Features.Dialogue [Header("Trigger Settings")] [Tooltip("Can the dialogue be retriggered after completion")] [SerializeField] private bool _isRetriggerable = false; - [SerializeField] private bool _requirePlayerTag = true; - [SerializeField] private string _playerTag = "Player"; + + protected override bool IsRetriggerable => _isRetriggerable; [Header("Distance Check")] [Tooltip("Pause dialogue if player exits the trigger zone")] @@ -41,29 +41,19 @@ namespace Unheimlich.Features.Dialogue [SerializeField] private bool _enableBlurEffect = true; private bool _hasTriggered = false; - private Collider _triggerCollider; private DialogueStateHandler _dialogueState; - private void Awake() + protected override void Awake() { - _triggerCollider = GetComponent(); + base.Awake(); _dialogueState = new DialogueStateHandler(this); - - if (!_triggerCollider.isTrigger) - { - Debug.LogWarning($"{gameObject.name}: Collider should be marked as Trigger!", this); - _triggerCollider.isTrigger = true; - } if (_floatingWordAnchor == null) _floatingWordAnchor = transform; } - private void OnTriggerEnter(Collider other) + protected override void OnPlayerEntered(Collider playerCollider) { - if (_requirePlayerTag && !other.CompareTag(_playerTag)) - return; - if (_dialogueState.IsCompleted && !_isRetriggerable) return; @@ -80,11 +70,8 @@ namespace Unheimlich.Features.Dialogue } } - private void OnTriggerExit(Collider other) + protected override void OnPlayerExited(Collider playerCollider) { - if (_requirePlayerTag && !other.CompareTag(_playerTag)) - return; - if (_pauseOnExit && DialogueManager.Instance != null && DialogueManager.Instance.IsDialogueActive) { if ((Object)DialogueManager.Instance.CurrentOwner == this) @@ -153,6 +140,7 @@ namespace Unheimlich.Features.Dialogue { _hasTriggered = false; _dialogueState.Reset(); + ResetZone(); } private void OnDestroy() @@ -161,20 +149,14 @@ namespace Unheimlich.Features.Dialogue DialogueManager.Instance.OnDialogueCompleted -= OnDialogueCompleted; } + private void OnValidate() + { + if (_localDialogueUI == null) + Debug.LogWarning($"[DialogueTriggerZone] '{gameObject.name}' has no Local Dialogue UI assigned. Assign the appropriate DialogueUI prefab variant (World, NPC, Room, Screen, etc.).", this); + } + private void OnDrawGizmosSelected() { - Collider col = GetComponent(); - if (col != null) - { - Gizmos.color = _hasTriggered ? Color.gray : Color.yellow; - Gizmos.matrix = transform.localToWorldMatrix; - - if (col is BoxCollider box) - Gizmos.DrawWireCube(box.center, box.size); - else if (col is SphereCollider sphere) - Gizmos.DrawWireSphere(sphere.center, sphere.radius); - } - if (_floatingWordAnchor != null) { Gizmos.color = Color.cyan; diff --git a/Assets/Unheimlich_POC/Scripts/Features/Dialogue/UI/ChoiceFocusHandler.cs b/Assets/Unheimlich_POC/Scripts/Features/Dialogue/UI/ChoiceFocusHandler.cs index 5a91c1d4..ec4dd235 100644 --- a/Assets/Unheimlich_POC/Scripts/Features/Dialogue/UI/ChoiceFocusHandler.cs +++ b/Assets/Unheimlich_POC/Scripts/Features/Dialogue/UI/ChoiceFocusHandler.cs @@ -253,7 +253,8 @@ namespace Unheimlich.Features.Dialogue.UI { if (!_positionCaptured) { - _startLocalPos = transform.localPosition; + // Subtract shake offset to get the clean base position, not the shaken one + _startLocalPos = transform.localPosition - _shakeOffset; _positionCaptured = true; LeanTween.cancel(gameObject); @@ -516,13 +517,15 @@ namespace Unheimlich.Features.Dialogue.UI ResetSketchFade(); + // Reset position capture and restart shake immediately — don't rely on a LeanTween + // callback for this, since stale tween IDs (Domain Reload disabled) can silently + // drop callbacks, leaving some words permanently non-shaking. + _positionCaptured = false; + StartOrganicShake(); + TweenHelper.MoveLocal(gameObject, _startLocalPos, duration, () => { - _positionCaptured = false; - if (DialogueManager.Instance != null) DialogueManager.Instance.UnlockFocus(); - - StartOrganicShake(); }, LeanTweenType.easeOutQuad); transform.localScale = Vector3.one * _originalScale; diff --git a/Assets/Unheimlich_POC/Scripts/Features/Hallucination.meta b/Assets/Unheimlich_POC/Scripts/Features/Hallucination.meta new file mode 100644 index 00000000..429db7df --- /dev/null +++ b/Assets/Unheimlich_POC/Scripts/Features/Hallucination.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 61bef91a8c6020442b3c036173f37714 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Unheimlich_POC/Scripts/Features/Hallucination/Data.meta b/Assets/Unheimlich_POC/Scripts/Features/Hallucination/Data.meta new file mode 100644 index 00000000..7ef10233 --- /dev/null +++ b/Assets/Unheimlich_POC/Scripts/Features/Hallucination/Data.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f73b9ba084838014a956e0a0a4150ab7 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Unheimlich_POC/Scripts/Features/Hallucination/Data/HallucinationEvent.cs b/Assets/Unheimlich_POC/Scripts/Features/Hallucination/Data/HallucinationEvent.cs new file mode 100644 index 00000000..bf7ade82 --- /dev/null +++ b/Assets/Unheimlich_POC/Scripts/Features/Hallucination/Data/HallucinationEvent.cs @@ -0,0 +1,42 @@ +using UnityEngine; + +namespace Unheimlich.Features.Hallucination +{ + /// + /// ScriptableObject describing a discrete hallucination event. + /// Configure in the inspector and pass to HallucinationManager.TriggerHallucinationEvent(). + /// + [CreateAssetMenu(fileName = "HallucinationEvent", menuName = "Unheimlich/Hallucination/Hallucination Event")] + public class HallucinationEvent : ScriptableObject + { + [Header("Identity")] + [Tooltip("Human-readable label for this event (used in logs and the inspector)")] + [SerializeField] private string _label; + + [Header("Ghost Word")] + [Tooltip("Spawn a ghost word that moves toward the player")] + [SerializeField] private bool _spawnGhostWord; + + [Tooltip("Text displayed by the ghost word")] + [SerializeField] private string _ghostWordText; + + [Tooltip("World-space spawn position offset from the anchor point")] + [SerializeField] private Vector3 _ghostWordSpawnOffset = new Vector3(0f, 1.5f, 2f); + + [Tooltip("Duration before the ghost word disappears (seconds)")] + [SerializeField] private float _ghostWordLifetime = 3f; + + [Header("Sanity Cost")] + [Tooltip("Sanity added to the player when this event fires (0 = no change)")] + [SerializeField, Range(0f, 1f)] private float _sanityCost = 0f; + + // ─── Public Accessors ────────────────────────────────────────────────────── + + public string Label => _label; + public bool SpawnGhostWord => _spawnGhostWord; + public string GhostWordText => _ghostWordText; + public Vector3 GhostWordSpawnOffset => _ghostWordSpawnOffset; + public float GhostWordLifetime => _ghostWordLifetime; + public float SanityCost => _sanityCost; + } +} diff --git a/Assets/Unheimlich_POC/Scripts/Features/Hallucination/Data/HallucinationEvent.cs.meta b/Assets/Unheimlich_POC/Scripts/Features/Hallucination/Data/HallucinationEvent.cs.meta new file mode 100644 index 00000000..6327eb8c --- /dev/null +++ b/Assets/Unheimlich_POC/Scripts/Features/Hallucination/Data/HallucinationEvent.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: b4c627a455825134087ba8c6f8931aed \ No newline at end of file diff --git a/Assets/Unheimlich_POC/Scripts/Features/Hallucination/Runtime.meta b/Assets/Unheimlich_POC/Scripts/Features/Hallucination/Runtime.meta new file mode 100644 index 00000000..acb118b8 --- /dev/null +++ b/Assets/Unheimlich_POC/Scripts/Features/Hallucination/Runtime.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9bb36c8cb81b7fd49b9612c4fa8f8c80 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Unheimlich_POC/Scripts/Features/Hallucination/Runtime/HallucinationManager.cs b/Assets/Unheimlich_POC/Scripts/Features/Hallucination/Runtime/HallucinationManager.cs new file mode 100644 index 00000000..42c41a52 --- /dev/null +++ b/Assets/Unheimlich_POC/Scripts/Features/Hallucination/Runtime/HallucinationManager.cs @@ -0,0 +1,272 @@ +using UnityEngine; +using UnityEngine.Rendering; +using UnityEngine.Rendering.Universal; +using System; +using System.Collections; +using Unheimlich.Core; + +namespace Unheimlich.Features.Hallucination +{ + /// + /// Central manager for the hallucination system. + /// Tracks the player's sanity level (0 = sane, 1 = fully insane) and drives all + /// hallucination effects: individual URP post-process overrides (with lerp), word shake + /// intensity, and ghost-word visibility via the HallucinationWordSpawner. + /// + /// Effects are applied directly on VolumeProfile overrides rather than on volume.weight, + /// so multiple volumes coexist without parameter conflicts. + /// + public class HallucinationManager : Singleton + { + // ─── Constants ───────────────────────────────────────────────────────────── + + private const float MinSanity = 0f; + private const float MaxSanity = 1f; + + // ─── Inspector ───────────────────────────────────────────────────────────── + + [Header("Sanity")] + [Tooltip("Starting sanity level (0 = sane, 1 = fully insane)")] + [SerializeField, Range(0f, 1f)] private float _initialSanity = 0f; + + [Tooltip("Sanity naturally recovers over time at this rate per second (0 = no recovery)")] + [SerializeField, Range(0f, 0.1f)] private float _sanityRecoveryRate = 0f; + + [Header("Effect Lerp")] + [Tooltip("Speed at which visual effects lerp toward the target sanity value")] + [SerializeField] private float _effectLerpSpeed = 2f; + + [Header("URP Post-Process Volume")] + [Tooltip("Volume containing the hallucination overrides (Chromatic Aberration, Lens Distortion, etc.)")] + [SerializeField] private Volume _hallucinationVolume; + + [Header("Chromatic Aberration")] + [SerializeField] private bool _driveChromaticAberration = true; + [SerializeField, Range(0f, 1f)] private float _chromaticAberrationMin = 0f; + [SerializeField, Range(0f, 1f)] private float _chromaticAberrationMax = 0.8f; + + [Header("Lens Distortion")] + [SerializeField] private bool _driveLensDistortion = true; + [SerializeField, Range(-1f, 1f)] private float _lensDistortionMin = 0f; + [SerializeField, Range(-1f, 1f)] private float _lensDistortionMax = -0.4f; + + [Header("Vignette")] + [SerializeField] private bool _driveVignette = true; + [SerializeField, Range(0f, 1f)] private float _vignetteMin = 0.3f; + [SerializeField, Range(0f, 1f)] private float _vignetteMax = 0.7f; + + [Header("Film Grain")] + [SerializeField] private bool _driveFilmGrain = true; + [SerializeField, Range(0f, 1f)] private float _filmGrainMin = 0f; + [SerializeField, Range(0f, 1f)] private float _filmGrainMax = 0.6f; + + [Header("Bloom")] + [SerializeField] private bool _driveBloom = true; + [Tooltip("Bloom intensity at sanity = 0")] + [SerializeField, Min(0f)] private float _bloomIntensityMin = 0f; + [Tooltip("Bloom intensity at sanity = 1")] + [SerializeField, Min(0f)] private float _bloomIntensityMax = 1f; + [Tooltip("Bloom threshold at sanity = 0 — raise this to suppress any bleed at zero sanity")] + [SerializeField, Min(0f)] private float _bloomThresholdMin = 1f; + [Tooltip("Bloom threshold at sanity = 1")] + [SerializeField, Min(0f)] private float _bloomThresholdMax = 0.5f; + [Tooltip("Bloom scatter (spread) at sanity = 0")] + [SerializeField, Range(0f, 1f)] private float _bloomScatterMin = 0f; + [Tooltip("Bloom scatter (spread) at sanity = 1")] + [SerializeField, Range(0f, 1f)] private float _bloomScatterMax = 0.7f; + [Tooltip("Bloom dirt texture intensity at sanity = 0")] + [SerializeField, Min(0f)] private float _bloomDirtIntensityMin = 0f; + [Tooltip("Bloom dirt texture intensity at sanity = 1")] + [SerializeField, Min(0f)] private float _bloomDirtIntensityMax = 0f; + + [Header("Word Shake")] + [Tooltip("Baseline shake multiplier at sanity = 0")] + [SerializeField] private float _shakeMultiplierAtZero = 1f; + + [Tooltip("Max shake multiplier at sanity = 1")] + [SerializeField] private float _shakeMultiplierAtOne = 3f; + + [Header("Debug")] + [SerializeField] private bool _debugMode; + + // ─── State ───────────────────────────────────────────────────────────────── + + private float _currentSanity; + private float _displayedSanity; // lerped value used for visual effects + private Coroutine _lerpCoroutine; + + // External systems can suppress the hallucination vignette (e.g. diapason listening mode). + private bool _vignetteExternallyOverridden; + + // Cached volume overrides + private ChromaticAberration _chromaticAberration; + private LensDistortion _lensDistortion; + private Vignette _vignette; + private FilmGrain _filmGrain; + private Bloom _bloom; + + // ─── Public API ──────────────────────────────────────────────────────────── + + /// Current logical sanity level in [0, 1]. 0 = sane, 1 = fully insane. + public float SanityLevel => _currentSanity; + + /// + /// Word shake multiplier computed from the lerped display sanity (smooth). + /// + public float WordShakeMultiplier => + Mathf.Lerp(_shakeMultiplierAtZero, _shakeMultiplierAtOne, _displayedSanity); + + /// Raised whenever the logical sanity level changes. Payload is the new value in [0, 1]. + public event Action OnSanityChanged; + + /// Raised when a discrete hallucination event is triggered (e.g. ghost word appears). + public event Action OnHallucinationTriggered; + + // ─── Lifecycle ───────────────────────────────────────────────────────────── + + protected override void OnAwake() + { + _currentSanity = Mathf.Clamp(_initialSanity, MinSanity, MaxSanity); + _displayedSanity = _currentSanity; + CacheVolumeOverrides(); + ApplyEffectsImmediate(_currentSanity); + } + + private void Update() + { + if (_sanityRecoveryRate > 0f && _currentSanity > MinSanity) + SetSanity(_currentSanity - _sanityRecoveryRate * Time.deltaTime); + } + + // ─── Public Methods ──────────────────────────────────────────────────────── + + /// + /// Increases the sanity level by (clamped to [0, 1]). + /// Effects lerp smoothly to the new value. + /// + public void AddInsanity(float amount) + { + SetSanity(_currentSanity + amount); + } + + /// + /// Directly sets the logical sanity level. Effects lerp smoothly to the new value. + /// + public void SetSanity(float value) + { + float clamped = Mathf.Clamp(value, MinSanity, MaxSanity); + + if (Mathf.Approximately(clamped, _currentSanity)) + return; + + _currentSanity = clamped; + OnSanityChanged?.Invoke(_currentSanity); + + if (_debugMode) + Debug.Log($"[HallucinationManager] Sanity → {_currentSanity:F2}", this); + + RestartLerp(); + } + + /// + /// Suppresses the hallucination vignette so an external system (e.g. diapason) can + /// take full control of vignette without additive blending artefacts. + /// Call with false when the external system is done. + /// + public void SetVignetteOverriddenExternally(bool overridden) + { + _vignetteExternallyOverridden = overridden; + + // Apply immediately so the vignette drops to zero without waiting for the lerp coroutine + if (_vignette != null) + _vignette.intensity.value = overridden ? 0f : Mathf.Lerp(_vignetteMin, _vignetteMax, _displayedSanity); + } + + /// Fires a discrete hallucination event (ghost word, vision flash, etc.). + public void TriggerHallucinationEvent(HallucinationEvent hallucinationEvent) + { + if (hallucinationEvent == null) + { + Debug.LogError("[HallucinationManager] Attempted to trigger a null HallucinationEvent!", this); + return; + } + + if (hallucinationEvent.SanityCost > 0f) + AddInsanity(hallucinationEvent.SanityCost); + + if (_debugMode) + Debug.Log($"[HallucinationManager] Event: {hallucinationEvent.name}", this); + + OnHallucinationTriggered?.Invoke(hallucinationEvent); + } + + // ─── Lerp ────────────────────────────────────────────────────────────────── + + private void RestartLerp() + { + if (_lerpCoroutine != null) + StopCoroutine(_lerpCoroutine); + + _lerpCoroutine = StartCoroutine(LerpEffects()); + } + + private IEnumerator LerpEffects() + { + while (!Mathf.Approximately(_displayedSanity, _currentSanity)) + { + _displayedSanity = Mathf.MoveTowards(_displayedSanity, _currentSanity, _effectLerpSpeed * Time.deltaTime); + ApplyEffectsImmediate(_displayedSanity); + yield return null; + } + + _displayedSanity = _currentSanity; + ApplyEffectsImmediate(_displayedSanity); + _lerpCoroutine = null; + } + + // ─── Effects ─────────────────────────────────────────────────────────────── + + private void CacheVolumeOverrides() + { + if (_hallucinationVolume == null || _hallucinationVolume.profile == null) + return; + + _hallucinationVolume.profile.TryGet(out _chromaticAberration); + _hallucinationVolume.profile.TryGet(out _lensDistortion); + _hallucinationVolume.profile.TryGet(out _vignette); + _hallucinationVolume.profile.TryGet(out _filmGrain); + _hallucinationVolume.profile.TryGet(out _bloom); + + // Keep volume weight at 1 permanently — we write individual override values directly. + // The hallucination volume must be on its OWN dedicated VolumeProfile, separate from + // the dialogue blur volume, to avoid weight conflicts between the two systems. + _hallucinationVolume.weight = 1f; + _hallucinationVolume.enabled = true; + } + + private void ApplyEffectsImmediate(float t) + { + if (_driveChromaticAberration && _chromaticAberration != null) + _chromaticAberration.intensity.value = Mathf.Lerp(_chromaticAberrationMin, _chromaticAberrationMax, t); + + if (_driveLensDistortion && _lensDistortion != null) + _lensDistortion.intensity.value = Mathf.Lerp(_lensDistortionMin, _lensDistortionMax, t); + + if (_driveVignette && _vignette != null && !_vignetteExternallyOverridden) + _vignette.intensity.value = Mathf.Lerp(_vignetteMin, _vignetteMax, t); + + if (_driveFilmGrain && _filmGrain != null) + _filmGrain.intensity.value = Mathf.Lerp(_filmGrainMin, _filmGrainMax, t); + + if (_driveBloom && _bloom != null) + { + // Drive all bloom parameters that can independently cause it to appear. + // intensity alone is not enough — threshold=0 or scatter>0 can bleed through. + _bloom.intensity.value = Mathf.Lerp(_bloomIntensityMin, _bloomIntensityMax, t); + _bloom.threshold.value = Mathf.Lerp(_bloomThresholdMin, _bloomThresholdMax, t); + _bloom.scatter.value = Mathf.Lerp(_bloomScatterMin, _bloomScatterMax, t); + _bloom.dirtIntensity.value = Mathf.Lerp(_bloomDirtIntensityMin, _bloomDirtIntensityMax, t); + } + } + } +} diff --git a/Assets/Unheimlich_POC/Scripts/Features/Hallucination/Runtime/HallucinationManager.cs.meta b/Assets/Unheimlich_POC/Scripts/Features/Hallucination/Runtime/HallucinationManager.cs.meta new file mode 100644 index 00000000..8962dfbf --- /dev/null +++ b/Assets/Unheimlich_POC/Scripts/Features/Hallucination/Runtime/HallucinationManager.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 6806feb984393b441ad0f1b20cf70333 \ No newline at end of file diff --git a/Assets/Unheimlich_POC/Scripts/Features/Hallucination/Runtime/HallucinationOnAudio.cs b/Assets/Unheimlich_POC/Scripts/Features/Hallucination/Runtime/HallucinationOnAudio.cs new file mode 100644 index 00000000..77d07386 --- /dev/null +++ b/Assets/Unheimlich_POC/Scripts/Features/Hallucination/Runtime/HallucinationOnAudio.cs @@ -0,0 +1,126 @@ +using UnityEngine; + +namespace Unheimlich.Features.Hallucination +{ + /// + /// Fires a hallucination trigger when a specific AudioSource plays, finishes, or reaches a timestamp. + /// Mirrors the pattern of ClueUnlockOnAudio but targets HallucinationManager. + /// + [RequireComponent(typeof(AudioSource))] + public class HallucinationOnAudio : MonoBehaviour + { + public enum FireCondition + { + OnPlay, + OnFinish, + OnTimeReached + } + + [Header("Audio Trigger")] + [Tooltip("When to fire the hallucination effect")] + [SerializeField] private FireCondition _fireCondition = FireCondition.OnPlay; + + [Tooltip("Playback time in seconds to reach before firing (only for OnTimeReached)")] + [SerializeField] private float _triggerTime = 1f; + + [Header("Hallucination Payload")] + [Tooltip("Amount of sanity to add when this fires (0 = no change)")] + [SerializeField, Range(0f, 1f)] private float _insanityAmount = 0f; + + [Tooltip("Optional discrete hallucination event to fire")] + [SerializeField] private HallucinationEvent _hallucinationEvent; + + [Header("Behaviour")] + [Tooltip("Prevent firing more than once per Play Mode session")] + [SerializeField] private bool _fireOnlyOnce = true; + + [Header("Debug")] + [SerializeField] private bool _debugMode; + + private AudioSource _audioSource; + private bool _hasFired; + private bool _isMonitoring; + + private void Awake() + { + _audioSource = GetComponent(); + } + + private void OnEnable() + { + _hasFired = false; + _isMonitoring = false; + + if (_audioSource != null && _audioSource.isPlaying) + StartMonitoring(); + } + + private void Update() + { + if (!_isMonitoring || (_fireOnlyOnce && _hasFired)) + return; + + if (_audioSource == null || !_audioSource.isPlaying) + { + if (_fireCondition == FireCondition.OnFinish) + Execute(); + + _isMonitoring = false; + return; + } + + if (_fireCondition == FireCondition.OnTimeReached && _audioSource.time >= _triggerTime) + Execute(); + } + + /// + /// Notify this component that the AudioSource has started playing. + /// Wire this to whatever code or event drives the AudioSource. + /// + public void OnAudioPlay() + { + StartMonitoring(); + + if (_fireCondition == FireCondition.OnPlay) + Execute(); + } + + /// + /// Resets the fired state so this can fire again. + /// + public void ResetFired() + { + _hasFired = false; + _isMonitoring = false; + } + + private void StartMonitoring() + { + _isMonitoring = true; + } + + private void Execute() + { + if (_fireOnlyOnce && _hasFired) + return; + + _hasFired = true; + _isMonitoring = false; + + if (HallucinationManager.Instance == null) + { + Debug.LogError("[HallucinationOnAudio] HallucinationManager not found!", this); + return; + } + + if (_insanityAmount > 0f) + HallucinationManager.Instance.AddInsanity(_insanityAmount); + + if (_hallucinationEvent != null) + HallucinationManager.Instance.TriggerHallucinationEvent(_hallucinationEvent); + + if (_debugMode) + Debug.Log($"[HallucinationOnAudio] Fired on '{_fireCondition}'. Sanity now: {HallucinationManager.Instance.SanityLevel:F2}", this); + } + } +} diff --git a/Assets/Unheimlich_POC/Scripts/Features/Hallucination/Runtime/HallucinationOnAudio.cs.meta b/Assets/Unheimlich_POC/Scripts/Features/Hallucination/Runtime/HallucinationOnAudio.cs.meta new file mode 100644 index 00000000..1705e892 --- /dev/null +++ b/Assets/Unheimlich_POC/Scripts/Features/Hallucination/Runtime/HallucinationOnAudio.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 57b4beb469df640499f96b38d4fa204b \ No newline at end of file diff --git a/Assets/Unheimlich_POC/Scripts/Features/Hallucination/Runtime/HallucinationTrigger.cs b/Assets/Unheimlich_POC/Scripts/Features/Hallucination/Runtime/HallucinationTrigger.cs new file mode 100644 index 00000000..e9357f43 --- /dev/null +++ b/Assets/Unheimlich_POC/Scripts/Features/Hallucination/Runtime/HallucinationTrigger.cs @@ -0,0 +1,68 @@ +using UnityEngine; +using Unheimlich.Core.Events; + +namespace Unheimlich.Features.Hallucination +{ + /// + /// Drives the HallucinationManager when its GameEventTrigger fires. + /// Can increase sanity, fire a discrete HallucinationEvent, or both. + /// Compose a GameEventTrigger on the same GameObject to control the firing condition + /// (OnStart, OnEnable, delay, once-flag, external call via UnityEvent, etc.). + /// + [RequireComponent(typeof(GameEventTrigger))] + public class HallucinationTrigger : MonoBehaviour + { + [Header("Sanity")] + [Tooltip("Amount of sanity to add when this trigger fires (0 = no change)")] + [SerializeField, Range(0f, 1f)] private float _insanityAmount = 0f; + + [Header("Hallucination Event")] + [Tooltip("Optional discrete hallucination event to fire (ghost word, vision flash, etc.)")] + [SerializeField] private HallucinationEvent _hallucinationEvent; + + [Header("Debug")] + [SerializeField] private bool _debugMode; + + private GameEventTrigger _eventTrigger; + + private void Awake() + { + _eventTrigger = GetComponent(); + _eventTrigger.OnTriggered += Trigger; + } + + private void OnDestroy() + { + if (_eventTrigger != null) + _eventTrigger.OnTriggered -= Trigger; + } + + /// + /// Fires the hallucination effect. Can be called directly from external scripts or UnityEvents. + /// + public void Trigger() + { + if (HallucinationManager.Instance == null) + { + Debug.LogError("[HallucinationTrigger] HallucinationManager not found in scene!", this); + return; + } + + if (_insanityAmount > 0f) + { + HallucinationManager.Instance.AddInsanity(_insanityAmount); + + if (_debugMode) + Debug.Log($"[HallucinationTrigger] Added {_insanityAmount:F2} insanity. New sanity: {HallucinationManager.Instance.SanityLevel:F2}", this); + } + + if (_hallucinationEvent != null) + { + HallucinationManager.Instance.TriggerHallucinationEvent(_hallucinationEvent); + + if (_debugMode) + Debug.Log($"[HallucinationTrigger] Fired event: {_hallucinationEvent.Label}", this); + } + } + } +} diff --git a/Assets/Unheimlich_POC/Scripts/Features/Hallucination/Runtime/HallucinationTrigger.cs.meta b/Assets/Unheimlich_POC/Scripts/Features/Hallucination/Runtime/HallucinationTrigger.cs.meta new file mode 100644 index 00000000..6582eb33 --- /dev/null +++ b/Assets/Unheimlich_POC/Scripts/Features/Hallucination/Runtime/HallucinationTrigger.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 5e1119e5c406d0346b0350dbcc91845f \ No newline at end of file diff --git a/Assets/Unheimlich_POC/Scripts/Features/Hallucination/Runtime/HallucinationTriggerZone.cs b/Assets/Unheimlich_POC/Scripts/Features/Hallucination/Runtime/HallucinationTriggerZone.cs new file mode 100644 index 00000000..86c35504 --- /dev/null +++ b/Assets/Unheimlich_POC/Scripts/Features/Hallucination/Runtime/HallucinationTriggerZone.cs @@ -0,0 +1,34 @@ +using UnityEngine; +using Unheimlich.Core.Events; + +namespace Unheimlich.Features.Hallucination +{ + /// + /// Fires a GameEventTrigger (and therefore a HallucinationTrigger) when the player + /// enters a physics trigger collider. Pair with GameEventTrigger + HallucinationTrigger + /// on the same GameObject. + /// + [RequireComponent(typeof(GameEventTrigger))] + public class HallucinationTriggerZone : TriggerZoneBase + { + [Header("Zone Behaviour")] + [Tooltip("Allow the zone to fire again after the player exits and re-enters")] + [SerializeField] private bool _retriggerable = false; + + protected override bool IsRetriggerable => _retriggerable; + + private GameEventTrigger _eventTrigger; + + protected override void Awake() + { + base.Awake(); + _eventTrigger = GetComponent(); + } + + protected override void OnPlayerEntered(Collider playerCollider) + { + _eventTrigger.Fire(); + } + } +} + diff --git a/Assets/Unheimlich_POC/Scripts/Features/Hallucination/Runtime/HallucinationTriggerZone.cs.meta b/Assets/Unheimlich_POC/Scripts/Features/Hallucination/Runtime/HallucinationTriggerZone.cs.meta new file mode 100644 index 00000000..e7f0a054 --- /dev/null +++ b/Assets/Unheimlich_POC/Scripts/Features/Hallucination/Runtime/HallucinationTriggerZone.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: e8fd091b4319d48448d266a24e885dae \ No newline at end of file diff --git a/Assets/Unheimlich_POC/Scripts/Features/Hallucination/Runtime/HallucinationWordSpawner.cs b/Assets/Unheimlich_POC/Scripts/Features/Hallucination/Runtime/HallucinationWordSpawner.cs new file mode 100644 index 00000000..db5353bd --- /dev/null +++ b/Assets/Unheimlich_POC/Scripts/Features/Hallucination/Runtime/HallucinationWordSpawner.cs @@ -0,0 +1,248 @@ +using UnityEngine; +using System.Collections; +using System.Collections.Generic; +using Unheimlich.Features.Dialogue.Data; +using Unheimlich.Features.Dialogue.UI; +using Unheimlich.Features.Player; +using Unheimlich.Core.Utils; +using RotationAxis = Unheimlich.Features.Dialogue.Data.RotationAxis; +using ChoiceSpawnMode = Unheimlich.Features.Dialogue.Data.ChoiceSpawnMode; + +namespace Unheimlich.Features.Hallucination +{ + /// + /// Listens to HallucinationManager.OnHallucinationTriggered and spawns ghost words + /// that float in world space and drift toward the player. + /// Reuses the existing ChoiceFocusHandler prefab and its organic shake system. + /// Add this component to the HallucinationManager GameObject or any persistent scene object. + /// + public class HallucinationWordSpawner : MonoBehaviour + { + private const float CanvasLocalScale = 0.01f; + + [Header("References")] + [Tooltip("Prefab used to render each ghost word (ChoiceFocusHandler)")] + [SerializeField] private ChoiceFocusHandler _wordPrefab; + + [Header("Ghost Word Behaviour")] + [Tooltip("Speed at which the ghost word drifts toward the player")] + [SerializeField] private float _driftSpeed = 0.4f; + + [Tooltip("Distance from the player at which the ghost word stops drifting")] + [SerializeField] private float _stopDistance = 1.5f; + + [Tooltip("Fade-in duration when a ghost word appears")] + [SerializeField] private float _fadeInDuration = 0.5f; + + [Tooltip("Fade-out duration before the ghost word is destroyed")] + [SerializeField] private float _fadeOutDuration = 0.8f; + + [Header("Shake Settings")] + [Tooltip("Shake radius applied to ghost words (world units)")] + [SerializeField] private float _shakeRadius = 15f; + + [Tooltip("Shake speed")] + [SerializeField] private float _shakeSpeed = 2f; + + [Tooltip("Shake smoothness")] + [SerializeField] private float _shakeSmoothness = 5f; + + private readonly List _activeWords = new List(); + + // ─── Lifecycle ───────────────────────────────────────────────────────────── + + private void OnEnable() + { + if (HallucinationManager.Instance != null) + HallucinationManager.Instance.OnHallucinationTriggered += OnHallucinationTriggered; + } + + private void OnDisable() + { + if (HallucinationManager.Instance != null) + HallucinationManager.Instance.OnHallucinationTriggered -= OnHallucinationTriggered; + } + + private void Update() + { + for (int i = _activeWords.Count - 1; i >= 0; i--) + { + GhostWordInstance instance = _activeWords[i]; + + if (instance.Handler == null) + { + _activeWords.RemoveAt(i); + continue; + } + + DriftTowardPlayer(instance); + } + } + + // ─── Event Handler ───────────────────────────────────────────────────────── + + private void OnHallucinationTriggered(HallucinationEvent hallucinationEvent) + { + if (!hallucinationEvent.SpawnGhostWord || _wordPrefab == null) + return; + + SpawnGhostWord(hallucinationEvent); + } + + // ─── Spawn ───────────────────────────────────────────────────────────────── + + private void SpawnGhostWord(HallucinationEvent hallucinationEvent) + { + if (PlayerController.Instance == null) + { + Debug.LogWarning("[HallucinationWordSpawner] PlayerController not found, cannot spawn ghost word.", this); + return; + } + + // World-space canvas container — mirrors the pattern in FloatingWordsSpawner + GameObject container = new GameObject($"GhostWord_{hallucinationEvent.Label}"); + Canvas canvas = container.AddComponent(); + canvas.renderMode = RenderMode.WorldSpace; + container.transform.localScale = Vector3.one * CanvasLocalScale; + + // Position relative to player + event offset + Vector3 spawnPosition = PlayerController.Instance.transform.position + + PlayerController.Instance.transform.TransformDirection(hallucinationEvent.GhostWordSpawnOffset); + container.transform.position = spawnPosition; + container.transform.LookAt(PlayerController.Instance.transform.position); + + // Spawn the word handler + ChoiceFocusHandler handler = Instantiate(_wordPrefab, container.transform); + handler.transform.localPosition = Vector3.zero; + handler.transform.localRotation = Quaternion.identity; + handler.transform.localScale = Vector3.one; + + // Build a ghost-only DialogueChoiceData (no NextNode, no localization key) + DialogueChoiceData ghostData = new DialogueChoiceData + { + ChoiceTextOverride = hallucinationEvent.GhostWordText, + NextNode = null + }; + + FloatingWordsSpawner.SpawnConfig config = BuildGhostConfig(); + handler.Setup(ghostData, config, disableFloatingEffects: false); + handler.StartOrganicShake(); + + // Fade-in via CanvasGroup + CanvasGroup canvasGroup = handler.GetComponent(); + if (canvasGroup == null) + canvasGroup = handler.gameObject.AddComponent(); + + canvasGroup.alpha = 0f; + TweenHelper.FadeCanvasGroup(canvasGroup, 1f, _fadeInDuration, null, LeanTweenType.easeOutQuad); + + GhostWordInstance instance = new GhostWordInstance + { + Handler = handler, + Container = container, + CanvasGroup = canvasGroup, + Lifetime = hallucinationEvent.GhostWordLifetime, + ElapsedTime = 0f, + IsFadingOut = false + }; + + _activeWords.Add(instance); + StartCoroutine(LifetimeRoutine(instance)); + } + + // ─── Drift ───────────────────────────────────────────────────────────────── + + private void DriftTowardPlayer(GhostWordInstance instance) + { + if (PlayerController.Instance == null || instance.IsFadingOut) + return; + + Transform container = instance.Container.transform; + Vector3 playerPos = PlayerController.Instance.transform.position; + float distance = Vector3.Distance(container.position, playerPos); + + if (distance > _stopDistance) + { + Vector3 direction = (playerPos - container.position).normalized; + container.position += direction * _driftSpeed * Time.deltaTime; + } + + // Always face the player + container.LookAt(playerPos); + } + + // ─── Lifetime ────────────────────────────────────────────────────────────── + + private IEnumerator LifetimeRoutine(GhostWordInstance instance) + { + float aliveTime = Mathf.Max(0f, instance.Lifetime - _fadeOutDuration); + yield return new WaitForSeconds(aliveTime); + + if (instance.Handler == null) + yield break; + + instance.IsFadingOut = true; + instance.Handler.StopOrganicShake(); + + if (instance.CanvasGroup != null) + TweenHelper.FadeCanvasGroup(instance.CanvasGroup, 0f, _fadeOutDuration, null, LeanTweenType.easeInQuad); + + yield return new WaitForSeconds(_fadeOutDuration); + + _activeWords.Remove(instance); + + if (instance.Container != null) + Destroy(instance.Container); + } + + // ─── Config ──────────────────────────────────────────────────────────────── + + private FloatingWordsSpawner.SpawnConfig BuildGhostConfig() + { + float sanityMultiplier = HallucinationManager.Instance != null + ? HallucinationManager.Instance.WordShakeMultiplier + : 1f; + + return new FloatingWordsSpawner.SpawnConfig + { + SpawnRadius = 0f, + SpawnHeightOffset = 0f, + RotationAxis = RotationAxis.Up, + EnableOrganicShake = true, + ForwardOffset = 0f, + TiltAngle = 0f, + RotationSpeed = 0f, + EnableRotation = false, + SpawnMode = ChoiceSpawnMode.AtAnchorPosition, + EnableFloating = false, + MergeDuration = 0.3f, + MergeScalePulse = 1f, + EnableGhostTrail = true, + GhostTrailAlpha = 0.25f, + GhostTrailDelay = 0.08f, + ShakeRadius = _shakeRadius * sanityMultiplier, + ShakeSpeed = _shakeSpeed, + ShakeSmoothness = _shakeSmoothness, + MoveTowardPlayerOnFocus = false, + FocusDistanceFromPlayer = _stopDistance, + DisableFloatingEffects = false, + DefaultScaleMultiplier = 1f, + EnableScaleVariation = false, + MinScaleVariation = 1f, + MaxScaleVariation = 1f + }; + } + + // ─── Internal ────────────────────────────────────────────────────────────── + + private class GhostWordInstance + { + public ChoiceFocusHandler Handler; + public GameObject Container; + public CanvasGroup CanvasGroup; + public float Lifetime; + public float ElapsedTime; + public bool IsFadingOut; + } + } +} diff --git a/Assets/Unheimlich_POC/Scripts/Features/Hallucination/Runtime/HallucinationWordSpawner.cs.meta b/Assets/Unheimlich_POC/Scripts/Features/Hallucination/Runtime/HallucinationWordSpawner.cs.meta new file mode 100644 index 00000000..6172604e --- /dev/null +++ b/Assets/Unheimlich_POC/Scripts/Features/Hallucination/Runtime/HallucinationWordSpawner.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 39db1c5f2a13bc04782e676a6ad133c8 \ No newline at end of file diff --git a/Assets/Unheimlich_POC/Scripts/Features/Player/Runtime/ListeningVignetteEffect.cs b/Assets/Unheimlich_POC/Scripts/Features/Player/Runtime/ListeningVignetteEffect.cs index 3c63d923..06f2a765 100644 --- a/Assets/Unheimlich_POC/Scripts/Features/Player/Runtime/ListeningVignetteEffect.cs +++ b/Assets/Unheimlich_POC/Scripts/Features/Player/Runtime/ListeningVignetteEffect.cs @@ -2,6 +2,7 @@ using UnityEngine; using UnityEngine.Rendering; using UnityEngine.Rendering.Universal; using Unheimlich.Core; +using Unheimlich.Features.Hallucination; namespace Unheimlich.Features.Player { @@ -75,6 +76,11 @@ namespace Unheimlich.Features.Player public void EnableVignette(bool enable) { _isEnabled = enable; + + // Suppress the hallucination vignette while diapason is active to avoid additive blending. + // Restores hallucination vignette control when diapason listening ends. + if (HallucinationManager.Instance != null) + HallucinationManager.Instance.SetVignetteOverriddenExternally(enable); } public void SetIntensity(float intensity) diff --git a/Assets/Unheimlich_POC/Scripts/World/Camera/Runtime/DetectiveBoardVirtualCamera.cs b/Assets/Unheimlich_POC/Scripts/World/Camera/Runtime/DetectiveBoardVirtualCamera.cs index 6a1ca275..ea34a2f0 100644 --- a/Assets/Unheimlich_POC/Scripts/World/Camera/Runtime/DetectiveBoardVirtualCamera.cs +++ b/Assets/Unheimlich_POC/Scripts/World/Camera/Runtime/DetectiveBoardVirtualCamera.cs @@ -222,36 +222,32 @@ namespace Unheimlich.World.CameraSystem if (Mouse.current != null) { Vector2 mousePos = Mouse.current.position.ReadValue(); - bool mouseHasMoved = Vector2.Distance(mousePos, _lastMousePosition) > 0.1f; _lastMousePosition = mousePos; - if (mouseHasMoved) + float screenWidth = Screen.width; + float screenHeight = Screen.height; + float borderPixels = _edgeBorderSize * Mathf.Min(screenWidth, screenHeight); + + if (mousePos.x >= 0f && mousePos.x < borderPixels) { - float screenWidth = Screen.width; - float screenHeight = Screen.height; - float borderPixels = _edgeBorderSize * Mathf.Min(screenWidth, screenHeight); - - if (mousePos.x < borderPixels) - { - panX = -(borderPixels - mousePos.x) / borderPixels; - hasInput = true; - } - else if (mousePos.x > screenWidth - borderPixels) - { - panX = (mousePos.x - (screenWidth - borderPixels)) / borderPixels; - hasInput = true; - } - - if (mousePos.y < borderPixels) - { - panY = -(borderPixels - mousePos.y) / borderPixels; - hasInput = true; - } - else if (mousePos.y > screenHeight - borderPixels) - { - panY = (mousePos.y - (screenHeight - borderPixels)) / borderPixels; - hasInput = true; - } + panX = -(borderPixels - mousePos.x) / borderPixels; + hasInput = true; + } + else if (mousePos.x > screenWidth - borderPixels && mousePos.x <= screenWidth) + { + panX = (mousePos.x - (screenWidth - borderPixels)) / borderPixels; + hasInput = true; + } + + if (mousePos.y >= 0f && mousePos.y < borderPixels) + { + panY = -(borderPixels - mousePos.y) / borderPixels; + hasInput = true; + } + else if (mousePos.y > screenHeight - borderPixels && mousePos.y <= screenHeight) + { + panY = (mousePos.y - (screenHeight - borderPixels)) / borderPixels; + hasInput = true; } }