wip : critical path - flash hallu
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -132,7 +132,7 @@ Material:
|
||||
- _Surface: 0
|
||||
- _VignettePower: 4.92
|
||||
- _VignetteStrength: 1
|
||||
- _Weight: 0.073516846
|
||||
- _Weight: 1
|
||||
- _WorkflowMode: 1
|
||||
- _XRMotionVectorsPass: 1
|
||||
- _ZWrite: 1
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f73b9ba084838014a956e0a0a4150ab7
|
||||
guid: 112fea371f2c0e04aa3b1e51cb2f5413
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
@@ -272,6 +272,98 @@ Transform:
|
||||
m_Children: []
|
||||
m_Father: {fileID: 1451475147}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &15290585
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 15290586}
|
||||
- component: {fileID: 15290589}
|
||||
- component: {fileID: 15290588}
|
||||
- component: {fileID: 15290587}
|
||||
m_Layer: 0
|
||||
m_Name: HallucinationFlashThree
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &15290586
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 15290585}
|
||||
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: 212095547}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &15290587
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 15290585}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.Image
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 0.50980395, g: 0.3606034, b: 0, a: 0}
|
||||
m_RaycastTarget: 0
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: 0}
|
||||
m_Type: 0
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 4
|
||||
m_FillAmount: 1
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
--- !u!222 &15290588
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 15290585}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &15290589
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 15290585}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 3aa8c513a3632aa4aa3b8ca2da6ca926, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: Assembly-CSharp::Unheimlich.Features.Hallucination.HallucinationFlash
|
||||
_image: {fileID: 15290587}
|
||||
_fadeIn: 0.05
|
||||
_hold: 0.2
|
||||
_fadeOut: 0.1
|
||||
--- !u!1001 &20800439
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -1365,6 +1457,55 @@ Transform:
|
||||
m_CorrespondingSourceObject: {fileID: -8679921383154817045, guid: 026d90e6b31bf0f47b6072ba92aef39a, type: 3}
|
||||
m_PrefabInstance: {fileID: 1720943979}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!1 &170452352
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 170452353}
|
||||
- component: {fileID: 170452354}
|
||||
m_Layer: 0
|
||||
m_Name: HallucinationVolumeTest
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &170452353
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 170452352}
|
||||
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: 235456880}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &170452354
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 170452352}
|
||||
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: 0
|
||||
blendDistance: 0
|
||||
weight: 0
|
||||
sharedProfile: {fileID: 11400000, guid: 619af039bbb9f674b94fb758efbbd8a9, type: 2}
|
||||
--- !u!1 &177618799
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -1458,6 +1599,19 @@ MonoBehaviour:
|
||||
m_StringArgument:
|
||||
m_BoolArgument: 1
|
||||
m_CallState: 2
|
||||
- m_Target: {fileID: 2002434881}
|
||||
m_TargetAssemblyTypeName: Unheimlich.Features.Hallucination.HallucinationPostProcess,
|
||||
Assembly-CSharp
|
||||
m_MethodName: RemoveSanityWrapper
|
||||
m_Mode: 1
|
||||
m_Arguments:
|
||||
m_ObjectArgument: {fileID: 0}
|
||||
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
|
||||
m_IntArgument: 0
|
||||
m_FloatArgument: 0
|
||||
m_StringArgument:
|
||||
m_BoolArgument: 1
|
||||
m_CallState: 2
|
||||
_onTriggerDelayed:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
@@ -1803,6 +1957,161 @@ Transform:
|
||||
m_CorrespondingSourceObject: {fileID: 992638687589661580, guid: 8a998c00fc583a54082d05343d747b99, type: 3}
|
||||
m_PrefabInstance: {fileID: 201468276}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!1001 &212095546
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_Modification:
|
||||
serializedVersion: 3
|
||||
m_TransformParent: {fileID: 1659664338}
|
||||
m_Modifications:
|
||||
- target: {fileID: 4369225580407928194, guid: f6df2f5ea61cfcb439be39356b1560fa, type: 3}
|
||||
propertyPath: m_Name
|
||||
value: Canvas
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6197325093082392848, guid: f6df2f5ea61cfcb439be39356b1560fa, type: 3}
|
||||
propertyPath: m_Color.a
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6197325093082392848, guid: f6df2f5ea61cfcb439be39356b1560fa, type: 3}
|
||||
propertyPath: m_RaycastTarget
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6305877997792785643, guid: f6df2f5ea61cfcb439be39356b1560fa, type: 3}
|
||||
propertyPath: _image
|
||||
value:
|
||||
objectReference: {fileID: 212095548}
|
||||
- target: {fileID: 6305877997792785643, guid: f6df2f5ea61cfcb439be39356b1560fa, type: 3}
|
||||
propertyPath: _fadeIn
|
||||
value: 0.05
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6305877997792785643, guid: f6df2f5ea61cfcb439be39356b1560fa, type: 3}
|
||||
propertyPath: _fadeOut
|
||||
value: 0.1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8447621161027149062, guid: f6df2f5ea61cfcb439be39356b1560fa, type: 3}
|
||||
propertyPath: m_Name
|
||||
value: HallucinationFlashOne
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8886833518829962744, guid: f6df2f5ea61cfcb439be39356b1560fa, type: 3}
|
||||
propertyPath: m_Pivot.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8886833518829962744, guid: f6df2f5ea61cfcb439be39356b1560fa, type: 3}
|
||||
propertyPath: m_Pivot.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8886833518829962744, guid: f6df2f5ea61cfcb439be39356b1560fa, type: 3}
|
||||
propertyPath: m_AnchorMax.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8886833518829962744, guid: f6df2f5ea61cfcb439be39356b1560fa, type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8886833518829962744, guid: f6df2f5ea61cfcb439be39356b1560fa, type: 3}
|
||||
propertyPath: m_AnchorMin.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8886833518829962744, guid: f6df2f5ea61cfcb439be39356b1560fa, type: 3}
|
||||
propertyPath: m_AnchorMin.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8886833518829962744, guid: f6df2f5ea61cfcb439be39356b1560fa, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8886833518829962744, guid: f6df2f5ea61cfcb439be39356b1560fa, type: 3}
|
||||
propertyPath: m_SizeDelta.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8886833518829962744, guid: f6df2f5ea61cfcb439be39356b1560fa, type: 3}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8886833518829962744, guid: f6df2f5ea61cfcb439be39356b1560fa, type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8886833518829962744, guid: f6df2f5ea61cfcb439be39356b1560fa, type: 3}
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8886833518829962744, guid: f6df2f5ea61cfcb439be39356b1560fa, type: 3}
|
||||
propertyPath: m_LocalRotation.w
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8886833518829962744, guid: f6df2f5ea61cfcb439be39356b1560fa, type: 3}
|
||||
propertyPath: m_LocalRotation.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8886833518829962744, guid: f6df2f5ea61cfcb439be39356b1560fa, type: 3}
|
||||
propertyPath: m_LocalRotation.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8886833518829962744, guid: f6df2f5ea61cfcb439be39356b1560fa, type: 3}
|
||||
propertyPath: m_LocalRotation.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8886833518829962744, guid: f6df2f5ea61cfcb439be39356b1560fa, type: 3}
|
||||
propertyPath: m_AnchoredPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8886833518829962744, guid: f6df2f5ea61cfcb439be39356b1560fa, type: 3}
|
||||
propertyPath: m_AnchoredPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8886833518829962744, guid: f6df2f5ea61cfcb439be39356b1560fa, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8886833518829962744, guid: f6df2f5ea61cfcb439be39356b1560fa, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8886833518829962744, guid: f6df2f5ea61cfcb439be39356b1560fa, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_RemovedGameObjects:
|
||||
- {fileID: 6237475490286447873, guid: f6df2f5ea61cfcb439be39356b1560fa, type: 3}
|
||||
m_AddedGameObjects:
|
||||
- targetCorrespondingSourceObject: {fileID: 8886833518829962744, guid: f6df2f5ea61cfcb439be39356b1560fa, type: 3}
|
||||
insertIndex: -1
|
||||
addedObject: {fileID: 1890221092}
|
||||
- targetCorrespondingSourceObject: {fileID: 8886833518829962744, guid: f6df2f5ea61cfcb439be39356b1560fa, type: 3}
|
||||
insertIndex: -1
|
||||
addedObject: {fileID: 15290586}
|
||||
m_AddedComponents: []
|
||||
m_SourcePrefab: {fileID: 100100000, guid: f6df2f5ea61cfcb439be39356b1560fa, type: 3}
|
||||
--- !u!224 &212095547 stripped
|
||||
RectTransform:
|
||||
m_CorrespondingSourceObject: {fileID: 8886833518829962744, guid: f6df2f5ea61cfcb439be39356b1560fa, type: 3}
|
||||
m_PrefabInstance: {fileID: 212095546}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!114 &212095548 stripped
|
||||
MonoBehaviour:
|
||||
m_CorrespondingSourceObject: {fileID: 6197325093082392848, guid: f6df2f5ea61cfcb439be39356b1560fa, type: 3}
|
||||
m_PrefabInstance: {fileID: 212095546}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.Image
|
||||
--- !u!114 &212095551 stripped
|
||||
MonoBehaviour:
|
||||
m_CorrespondingSourceObject: {fileID: 6305877997792785643, guid: f6df2f5ea61cfcb439be39356b1560fa, type: 3}
|
||||
m_PrefabInstance: {fileID: 212095546}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 3aa8c513a3632aa4aa3b8ca2da6ca926, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: Assembly-CSharp::Unheimlich.Features.Hallucination.HallucinationFlash
|
||||
--- !u!1 &215874833
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -1960,6 +2269,7 @@ Transform:
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 832575519}
|
||||
- {fileID: 170452353}
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &236163246
|
||||
@@ -3802,6 +4112,38 @@ Light:
|
||||
m_LightUnit: 1
|
||||
m_LuxAtDistance: 1
|
||||
m_EnableSpotReflector: 1
|
||||
--- !u!1 &459022361
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 459022362}
|
||||
m_Layer: 0
|
||||
m_Name: HallucinationPostProcessFX
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &459022362
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 459022361}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 2002434880}
|
||||
m_Father: {fileID: 1786720794}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!4 &461116116 stripped
|
||||
Transform:
|
||||
m_CorrespondingSourceObject: {fileID: -8380213319930610923, guid: 026d90e6b31bf0f47b6072ba92aef39a, type: 3}
|
||||
@@ -7181,7 +7523,7 @@ GameObject:
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
m_IsActive: 0
|
||||
--- !u!114 &832575518
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -13386,6 +13728,38 @@ Transform:
|
||||
- {fileID: 642981702}
|
||||
m_Father: {fileID: 949216163}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &1659664337
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1659664338}
|
||||
m_Layer: 0
|
||||
m_Name: ///UI
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &1659664338
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1659664337}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 4.83357, y: 0, z: 3.41586}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 212095547}
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &1664722453
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -13680,6 +14054,7 @@ MonoBehaviour:
|
||||
Turns: 0
|
||||
TotalAngle: 0
|
||||
Progression: 0
|
||||
TotalProgression: 0
|
||||
_references:
|
||||
RendererData: {fileID: 11400000, guid: f288ae1f4751b564a96ac7587541f7a2, type: 2}
|
||||
Stairs: {fileID: 1584967889}
|
||||
@@ -13696,6 +14071,7 @@ MonoBehaviour:
|
||||
Offset: -12.25
|
||||
StartAngle: 450
|
||||
EndAngle: 720
|
||||
AdditionalTopAngle: 360
|
||||
_events:
|
||||
OnInside:
|
||||
m_PersistentCalls:
|
||||
@@ -13838,6 +14214,105 @@ MonoBehaviour:
|
||||
m_StringArgument:
|
||||
m_BoolArgument: 0
|
||||
m_CallState: 2
|
||||
HallucinationTriggers:
|
||||
- Progression: 0.1
|
||||
OnReached:
|
||||
m_PersistentCalls:
|
||||
m_Calls:
|
||||
- m_Target: {fileID: 2002434881}
|
||||
m_TargetAssemblyTypeName: Unheimlich.Features.Hallucination.HallucinationPostProcess,
|
||||
Assembly-CSharp
|
||||
m_MethodName: AddSanityWrapper
|
||||
m_Mode: 1
|
||||
m_Arguments:
|
||||
m_ObjectArgument: {fileID: 0}
|
||||
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
|
||||
m_IntArgument: 0
|
||||
m_FloatArgument: 0
|
||||
m_StringArgument:
|
||||
m_BoolArgument: 0
|
||||
m_CallState: 2
|
||||
- m_Target: {fileID: 212095551}
|
||||
m_TargetAssemblyTypeName: Unheimlich.Features.Hallucination.HallucinationFlash,
|
||||
Assembly-CSharp
|
||||
m_MethodName: Play
|
||||
m_Mode: 1
|
||||
m_Arguments:
|
||||
m_ObjectArgument: {fileID: 0}
|
||||
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
|
||||
m_IntArgument: 0
|
||||
m_FloatArgument: 0
|
||||
m_StringArgument:
|
||||
m_BoolArgument: 0
|
||||
m_CallState: 2
|
||||
Triggered: 0
|
||||
- Progression: 0.5
|
||||
OnReached:
|
||||
m_PersistentCalls:
|
||||
m_Calls:
|
||||
- m_Target: {fileID: 2002434881}
|
||||
m_TargetAssemblyTypeName: Unheimlich.Features.Hallucination.HallucinationPostProcess,
|
||||
Assembly-CSharp
|
||||
m_MethodName: AddSanityWrapper
|
||||
m_Mode: 1
|
||||
m_Arguments:
|
||||
m_ObjectArgument: {fileID: 0}
|
||||
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
|
||||
m_IntArgument: 0
|
||||
m_FloatArgument: 0
|
||||
m_StringArgument:
|
||||
m_BoolArgument: 0
|
||||
m_CallState: 2
|
||||
- m_Target: {fileID: 1890221095}
|
||||
m_TargetAssemblyTypeName: Unheimlich.Features.Hallucination.HallucinationFlash,
|
||||
Assembly-CSharp
|
||||
m_MethodName: Play
|
||||
m_Mode: 1
|
||||
m_Arguments:
|
||||
m_ObjectArgument: {fileID: 0}
|
||||
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
|
||||
m_IntArgument: 0
|
||||
m_FloatArgument: 0
|
||||
m_StringArgument:
|
||||
m_BoolArgument: 0
|
||||
m_CallState: 2
|
||||
Triggered: 0
|
||||
- Progression: 0.9
|
||||
OnReached:
|
||||
m_PersistentCalls:
|
||||
m_Calls:
|
||||
- m_Target: {fileID: 2002434881}
|
||||
m_TargetAssemblyTypeName: Unheimlich.Features.Hallucination.HallucinationPostProcess,
|
||||
Assembly-CSharp
|
||||
m_MethodName: AddSanityWrapper
|
||||
m_Mode: 1
|
||||
m_Arguments:
|
||||
m_ObjectArgument: {fileID: 0}
|
||||
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
|
||||
m_IntArgument: 0
|
||||
m_FloatArgument: 0
|
||||
m_StringArgument:
|
||||
m_BoolArgument: 0
|
||||
m_CallState: 2
|
||||
- m_Target: {fileID: 15290589}
|
||||
m_TargetAssemblyTypeName: Unheimlich.Features.Hallucination.HallucinationFlash,
|
||||
Assembly-CSharp
|
||||
m_MethodName: Play
|
||||
m_Mode: 1
|
||||
m_Arguments:
|
||||
m_ObjectArgument: {fileID: 0}
|
||||
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
|
||||
m_IntArgument: 0
|
||||
m_FloatArgument: 0
|
||||
m_StringArgument:
|
||||
m_BoolArgument: 0
|
||||
m_CallState: 2
|
||||
Triggered: 0
|
||||
- Progression: 0.994
|
||||
OnReached:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
Triggered: 0
|
||||
--- !u!1001 &1720943979
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -16245,7 +16720,7 @@ PrefabInstance:
|
||||
- target: {fileID: 6624802822550572559, guid: 026d90e6b31bf0f47b6072ba92aef39a, type: 3}
|
||||
propertyPath: 'm_Materials.Array.data[0]'
|
||||
value:
|
||||
objectReference: {fileID: 2100000, guid: 041244f79f70adf48a95dc71fd2ae233, type: 2}
|
||||
objectReference: {fileID: 2100000, guid: fe9273bfed38a3247be7bd892c0b44ed, type: 2}
|
||||
- target: {fileID: 6649221244018378369, guid: 026d90e6b31bf0f47b6072ba92aef39a, type: 3}
|
||||
propertyPath: m_StaticEditorFlags
|
||||
value: 2147483647
|
||||
@@ -17331,6 +17806,7 @@ Transform:
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 923492554}
|
||||
- {fileID: 459022362}
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &1806877697 stripped
|
||||
@@ -17759,6 +18235,98 @@ MeshCollider:
|
||||
m_Convex: 0
|
||||
m_CookingOptions: 30
|
||||
m_Mesh: {fileID: -8697944735082660400, guid: 026d90e6b31bf0f47b6072ba92aef39a, type: 3}
|
||||
--- !u!1 &1890221091
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1890221092}
|
||||
- component: {fileID: 1890221095}
|
||||
- component: {fileID: 1890221094}
|
||||
- component: {fileID: 1890221093}
|
||||
m_Layer: 0
|
||||
m_Name: HallucinationFlashTwo
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &1890221092
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1890221091}
|
||||
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: 212095547}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &1890221093
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1890221091}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.Image
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 0.43093073, g: 0, b: 0.509434, a: 0}
|
||||
m_RaycastTarget: 0
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: 0}
|
||||
m_Type: 0
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 4
|
||||
m_FillAmount: 1
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
--- !u!222 &1890221094
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1890221091}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &1890221095
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1890221091}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 3aa8c513a3632aa4aa3b8ca2da6ca926, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: Assembly-CSharp::Unheimlich.Features.Hallucination.HallucinationFlash
|
||||
_image: {fileID: 1890221093}
|
||||
_fadeIn: 0.05
|
||||
_hold: 0.2
|
||||
_fadeOut: 0.1
|
||||
--- !u!1 &1895333868
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -17888,7 +18456,7 @@ GameObject:
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
m_IsActive: 0
|
||||
--- !u!4 &1910661565
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -18213,6 +18781,57 @@ Light:
|
||||
m_LightUnit: 1
|
||||
m_LuxAtDistance: 1
|
||||
m_EnableSpotReflector: 1
|
||||
--- !u!1 &2002434879
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 2002434880}
|
||||
- component: {fileID: 2002434881}
|
||||
m_Layer: 0
|
||||
m_Name: HallucinationPostProcessTest
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &2002434880
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2002434879}
|
||||
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: 459022362}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &2002434881
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2002434879}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 8794f9ed5592b56489a289359e19bfed, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: Assembly-CSharp::Unheimlich.Features.Hallucination.HallucinationPostProcess
|
||||
_volume: {fileID: 170452354}
|
||||
_shaderMaterial: {fileID: 0}
|
||||
_initialSanity: 0
|
||||
_autoDecayRate: 0
|
||||
_wrapperAddAmount: 0.35
|
||||
_wrapperRemoveAmount: 1
|
||||
_wrapperDuration: 2
|
||||
--- !u!1 &2010439095
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -23952,5 +24571,6 @@ SceneRoots:
|
||||
- {fileID: 581223803}
|
||||
- {fileID: 1107210254}
|
||||
- {fileID: 235456880}
|
||||
- {fileID: 1659664338}
|
||||
- {fileID: 1669380717}
|
||||
- {fileID: 268891122}
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
%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: d7fd9488000d3734a9e00ee676215985, type: 3}
|
||||
m_Name: HallucinationVolumeTest Profile
|
||||
m_EditorClassIdentifier: Unity.RenderPipelines.Core.Runtime::UnityEngine.Rendering.VolumeProfile
|
||||
components:
|
||||
- {fileID: 3316964721953299656}
|
||||
- {fileID: 8996032220948370133}
|
||||
--- !u!114 &3316964721953299656
|
||||
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.633
|
||||
texture:
|
||||
m_OverrideState: 0
|
||||
m_Value: {fileID: 0}
|
||||
--- !u!114 &8996032220948370133
|
||||
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
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 619af039bbb9f674b94fb758efbbd8a9
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -160,8 +160,6 @@ namespace Unheimlich.Features.Dialogue.UI
|
||||
StartShakeInternal();
|
||||
}
|
||||
|
||||
private void OnEnable() => HallucinationLabelRegistry.Register(this);
|
||||
private void OnDisable() => HallucinationLabelRegistry.Unregister(this);
|
||||
|
||||
private void Update()
|
||||
{
|
||||
|
||||
@@ -1,86 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using Unheimlich.Features.Dialogue.UI;
|
||||
|
||||
namespace Unheimlich.Features.Hallucination
|
||||
{
|
||||
// ─── Per-label override data ───────────────────────────────────────────────
|
||||
|
||||
/// <summary>
|
||||
/// Describes how a specific FloatingLabel should behave when a HallucinationEvent fires.
|
||||
/// </summary>
|
||||
[System.Serializable]
|
||||
public class FloatingLabelOverride
|
||||
{
|
||||
[Tooltip("The FloatingLabel to override when this event fires.")]
|
||||
public FloatingLabel Target;
|
||||
|
||||
[Header("Shake Override")]
|
||||
[Tooltip("Absolute shake radius applied during the override (world units). 0 = no shake.")]
|
||||
[Min(0f)] public float ShakeRadius = 0.15f;
|
||||
[Tooltip("Shake speed during the override.")]
|
||||
[Min(0f)] public float ShakeSpeed = 3f;
|
||||
[Tooltip("Shake smoothness during the override.")]
|
||||
[Min(0f)] public float ShakeSmoothness = 4f;
|
||||
|
||||
[Header("Ghost Trail Override")]
|
||||
public bool GhostEnabled = true;
|
||||
[Range(0f, 1f)] public float GhostAlpha = 0.5f;
|
||||
|
||||
[Header("Duration")]
|
||||
[Tooltip("How long the override lasts (seconds) before reverting to the sanity baseline.")]
|
||||
[Min(0f)] public float Duration = 2f;
|
||||
}
|
||||
|
||||
// ─── ScriptableObject ──────────────────────────────────────────────────────
|
||||
|
||||
/// <summary>
|
||||
/// ScriptableObject describing a discrete hallucination event.
|
||||
///
|
||||
/// Ghost word spawn removed. Words live on FloatingLabel components in the scene.
|
||||
/// LabelOverrides targets specific labels with timed shake/ghost overrides.
|
||||
/// </summary>
|
||||
[CreateAssetMenu(
|
||||
fileName = "HallucinationEvent",
|
||||
menuName = "Unheimlich/Hallucination/Hallucination Event")]
|
||||
public class HallucinationEvent : ScriptableObject
|
||||
{
|
||||
[Header("Identity")]
|
||||
[SerializeField] private string _label;
|
||||
|
||||
[Header("Sanity Cost")]
|
||||
[SerializeField, Range(0f, 1f)] private float _sanityCost = 0f;
|
||||
|
||||
[Header("Floating Label Overrides")]
|
||||
[Tooltip("One entry per FloatingLabel to affect when this event fires.")]
|
||||
[SerializeField] private List<FloatingLabelOverride> _labelOverrides = new();
|
||||
|
||||
// ─── Public Accessors ──────────────────────────────────────────────────
|
||||
|
||||
public string Label => _label;
|
||||
public float SanityCost => _sanityCost;
|
||||
public IReadOnlyList<FloatingLabelOverride> LabelOverrides => _labelOverrides;
|
||||
|
||||
// ─── Internal ─────────────────────────────────────────────────────────
|
||||
|
||||
/// <summary>
|
||||
/// Pushes all label overrides onto their target FloatingLabels.
|
||||
/// Called by HallucinationManager.TriggerHallucinationEvent().
|
||||
/// </summary>
|
||||
internal void ApplyLabelOverrides()
|
||||
{
|
||||
foreach (FloatingLabelOverride entry in _labelOverrides)
|
||||
{
|
||||
if (entry.Target == null) continue;
|
||||
|
||||
entry.Target.ApplyOverride(
|
||||
entry.ShakeRadius,
|
||||
entry.ShakeSpeed,
|
||||
entry.ShakeSmoothness,
|
||||
entry.GhostEnabled,
|
||||
entry.GhostAlpha,
|
||||
entry.Duration);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b4c627a455825134087ba8c6f8931aed
|
||||
@@ -0,0 +1,70 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace Unheimlich.Features.Hallucination
|
||||
{
|
||||
/// <summary>
|
||||
/// Plays a full-screen image flash on the HUD canvas.
|
||||
/// Fades are handled via LeanTween.
|
||||
/// Call <see cref="Play"/> to trigger the flash.
|
||||
/// </summary>
|
||||
public class HallucinationFlash : MonoBehaviour
|
||||
{
|
||||
[Header("Target")]
|
||||
[SerializeField] private Image _image;
|
||||
|
||||
[Header("Timings")]
|
||||
[SerializeField, Min(0f)] private float _fadeIn = 0.1f;
|
||||
[SerializeField, Min(0f)] private float _hold = 0.2f;
|
||||
[SerializeField, Min(0f)] private float _fadeOut = 0.5f;
|
||||
|
||||
// ─── State ─────────────────────────────────────────────────────────────
|
||||
|
||||
private int _tweenId = -1;
|
||||
|
||||
// ─── Public API ────────────────────────────────────────────────────────
|
||||
|
||||
/// <summary>
|
||||
/// Plays the flash sequence.
|
||||
/// Interrupts any flash already in progress.
|
||||
/// Safe to wire to any UnityEvent with no arguments.
|
||||
/// </summary>
|
||||
public void Play()
|
||||
{
|
||||
_image.color = new Color(_image.color.r, _image.color.g, _image.color.b, 0f);
|
||||
|
||||
CancelCurrent();
|
||||
|
||||
_tweenId = LeanTween.value(gameObject, 0f, 1f, _fadeIn)
|
||||
.setEase(LeanTweenType.easeOutQuad)
|
||||
.setOnUpdate(SetAlpha)
|
||||
.setOnComplete(() =>
|
||||
{
|
||||
_tweenId = LeanTween.value(gameObject, 1f, 1f, _hold)
|
||||
.setOnComplete(() =>
|
||||
{
|
||||
_tweenId = LeanTween.value(gameObject, 1f, 0f, _fadeOut)
|
||||
.setEase(LeanTweenType.easeInQuad)
|
||||
.setOnUpdate(SetAlpha)
|
||||
.id;
|
||||
}).id;
|
||||
}).id;
|
||||
}
|
||||
|
||||
// ─── Private ───────────────────────────────────────────────────────────
|
||||
|
||||
private void CancelCurrent()
|
||||
{
|
||||
if (_tweenId == -1) return;
|
||||
LeanTween.cancel(_tweenId);
|
||||
_tweenId = -1;
|
||||
}
|
||||
|
||||
private void SetAlpha(float alpha)
|
||||
{
|
||||
Color c = _image.color;
|
||||
c.a = alpha;
|
||||
_image.color = c;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3aa8c513a3632aa4aa3b8ca2da6ca926
|
||||
@@ -1,35 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using Unheimlich.Features.Dialogue.UI;
|
||||
|
||||
namespace Unheimlich.Features.Hallucination
|
||||
{
|
||||
/// <summary>
|
||||
/// Static registry that FloatingLabel instances self-register into on OnEnable/OnDisable.
|
||||
/// Lets HallucinationManager iterate active labels in a radius without any FindObjectsOfType.
|
||||
/// </summary>
|
||||
public static class HallucinationLabelRegistry
|
||||
{
|
||||
private static readonly HashSet<FloatingLabel> _labels = new();
|
||||
|
||||
public static void Register(FloatingLabel label) => _labels.Add(label);
|
||||
public static void Unregister(FloatingLabel label) => _labels.Remove(label);
|
||||
|
||||
/// <summary>
|
||||
/// Returns all registered labels whose transform is within <paramref name="radius"/>
|
||||
/// of <paramref name="center"/>. Results are written into <paramref name="results"/>
|
||||
/// (which is cleared first) to avoid allocations per call.
|
||||
/// </summary>
|
||||
public static void GetLabelsInRadius(Vector3 center, float radius, List<FloatingLabel> results)
|
||||
{
|
||||
results.Clear();
|
||||
float sqrRadius = radius * radius;
|
||||
foreach (FloatingLabel label in _labels)
|
||||
{
|
||||
if (label == null) continue;
|
||||
if ((label.transform.position - center).sqrMagnitude <= sqrRadius)
|
||||
results.Add(label);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
-2
@@ -1,2 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 63e30fb837ed3ab4182c89a053c11a6a
|
||||
@@ -1,278 +0,0 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.Rendering;
|
||||
using UnityEngine.Rendering.Universal;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Unheimlich.Core;
|
||||
using Unheimlich.Features.Dialogue.UI;
|
||||
|
||||
namespace Unheimlich.Features.Hallucination
|
||||
{
|
||||
/// <summary>
|
||||
/// Central manager for the hallucination system.
|
||||
public class HallucinationManager : Singleton<HallucinationManager>
|
||||
{
|
||||
private const float MinSanity = 0f;
|
||||
private const float MaxSanity = 1f;
|
||||
|
||||
[Header("Sanity")]
|
||||
[SerializeField, Range(0f, 1f)] private float _initialSanity = 0f;
|
||||
[SerializeField, Range(0f, 0.1f)] private float _sanityRecoveryRate = 0f;
|
||||
|
||||
[Header("Effect Lerp")]
|
||||
[SerializeField] private float _effectLerpSpeed = 2f;
|
||||
|
||||
[Header("URP Post-Process Volume")]
|
||||
[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;
|
||||
[SerializeField, Min(0f)] private float _bloomIntensityMin = 0f;
|
||||
[SerializeField, Min(0f)] private float _bloomIntensityMax = 1f;
|
||||
[SerializeField, Min(0f)] private float _bloomThresholdMin = 1f;
|
||||
[SerializeField, Min(0f)] private float _bloomThresholdMax = 0.5f;
|
||||
[SerializeField, Range(0f, 1f)] private float _bloomScatterMin = 0f;
|
||||
[SerializeField, Range(0f, 1f)] private float _bloomScatterMax = 0.7f;
|
||||
[SerializeField, Min(0f)] private float _bloomDirtIntensityMin = 0f;
|
||||
[SerializeField, Min(0f)] private float _bloomDirtIntensityMax = 0f;
|
||||
|
||||
[Header("Floating Label — Baseline Influence")]
|
||||
[Tooltip("Labels within this radius of the player receive the sanity-driven baseline.")]
|
||||
[SerializeField, Min(0f)] private float _labelInfluenceRadius = 12f;
|
||||
|
||||
[Header("Floating Label — Shake")]
|
||||
[Tooltip("Shake radius applied to labels at sanity = 0.")]
|
||||
[SerializeField, Min(0f)] private float _labelShakeRadiusAtZero = 0f;
|
||||
[SerializeField, Min(0f)] private float _labelShakeSpeedAtZero = 1.5f;
|
||||
[SerializeField, Min(0f)] private float _labelShakeSmoothnessAtZero = 2f;
|
||||
|
||||
[Tooltip("Shake radius applied to labels at sanity = 1.")]
|
||||
[SerializeField, Min(0f)] private float _labelShakeRadiusAtOne = 0.2f;
|
||||
[SerializeField, Min(0f)] private float _labelShakeSpeedAtOne = 4f;
|
||||
[SerializeField, Min(0f)] private float _labelShakeSmoothnessAtOne = 5f;
|
||||
|
||||
[Header("Floating Label — Ghost Trail")]
|
||||
[SerializeField] private bool _ghostEnabledAtZero = false;
|
||||
[SerializeField] private bool _ghostEnabledAtOne = true;
|
||||
[SerializeField, Range(0f, 1f)] private float _ghostAlphaMin = 0.1f;
|
||||
[SerializeField, Range(0f, 1f)] private float _ghostAlphaMax = 0.5f;
|
||||
|
||||
[Header("Word Shake (legacy — for other systems)")]
|
||||
[SerializeField] private float _shakeMultiplierLegacyAtZero = 1f;
|
||||
[SerializeField] private float _shakeMultiplierLegacyAtOne = 3f;
|
||||
|
||||
[Header("Debug")]
|
||||
[SerializeField] private bool _debugMode;
|
||||
|
||||
// ─── State ─────────────────────────────────────────────────────────────
|
||||
|
||||
private float _currentSanity;
|
||||
private float _displayedSanity;
|
||||
private Coroutine _lerpCoroutine;
|
||||
private bool _vignetteExternallyOverridden;
|
||||
|
||||
private ChromaticAberration _chromaticAberration;
|
||||
private LensDistortion _lensDistortion;
|
||||
private Vignette _vignette;
|
||||
private FilmGrain _filmGrain;
|
||||
private Bloom _bloom;
|
||||
|
||||
private Transform _playerTransform;
|
||||
private readonly List<FloatingLabel> _labelsInRange = new();
|
||||
|
||||
// ─── Public API ────────────────────────────────────────────────────────
|
||||
|
||||
public float SanityLevel => _currentSanity;
|
||||
|
||||
public float WordShakeMultiplier =>
|
||||
Mathf.Lerp(_shakeMultiplierLegacyAtZero, _shakeMultiplierLegacyAtOne, _displayedSanity);
|
||||
|
||||
public event Action<float> OnSanityChanged;
|
||||
public event Action<HallucinationEvent> OnHallucinationTriggered;
|
||||
|
||||
// ─── Lifecycle ─────────────────────────────────────────────────────────
|
||||
|
||||
protected override void OnAwake()
|
||||
{
|
||||
_currentSanity = Mathf.Clamp(_initialSanity, MinSanity, MaxSanity);
|
||||
_displayedSanity = _currentSanity;
|
||||
CacheVolumeOverrides();
|
||||
ApplyPostProcessImmediate(_currentSanity);
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (_sanityRecoveryRate > 0f && _currentSanity > MinSanity)
|
||||
SetSanity(_currentSanity - _sanityRecoveryRate * Time.deltaTime);
|
||||
|
||||
DriveFloatingLabelBaseline();
|
||||
}
|
||||
|
||||
// ─── Public Methods ────────────────────────────────────────────────────
|
||||
|
||||
public void AddInsanity(float amount) => SetSanity(_currentSanity + amount);
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
public void SetVignetteOverriddenExternally(bool overridden)
|
||||
{
|
||||
_vignetteExternallyOverridden = overridden;
|
||||
if (_vignette != null)
|
||||
_vignette.intensity.value = overridden
|
||||
? 0f
|
||||
: Mathf.Lerp(_vignetteMin, _vignetteMax, _displayedSanity);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Fires a discrete hallucination event:
|
||||
/// 1. Applies SanityCost.
|
||||
/// 2. Dispatches per-label overrides defined in the event asset.
|
||||
/// 3. Raises OnHallucinationTriggered.
|
||||
/// </summary>
|
||||
public void TriggerHallucinationEvent(HallucinationEvent hallucinationEvent)
|
||||
{
|
||||
if (hallucinationEvent == null)
|
||||
{
|
||||
Debug.LogError("[HallucinationManager] Null HallucinationEvent!", this);
|
||||
return;
|
||||
}
|
||||
|
||||
if (hallucinationEvent.SanityCost > 0f)
|
||||
AddInsanity(hallucinationEvent.SanityCost);
|
||||
|
||||
hallucinationEvent.ApplyLabelOverrides();
|
||||
|
||||
if (_debugMode)
|
||||
Debug.Log($"[HallucinationManager] Event: {hallucinationEvent.Label} " +
|
||||
$"({hallucinationEvent.LabelOverrides.Count} label overrides)", this);
|
||||
|
||||
OnHallucinationTriggered?.Invoke(hallucinationEvent);
|
||||
}
|
||||
|
||||
// ─── Floating Label Baseline ───────────────────────────────────────────
|
||||
|
||||
private void DriveFloatingLabelBaseline()
|
||||
{
|
||||
EnsurePlayerTransform();
|
||||
if (_playerTransform == null) return;
|
||||
|
||||
HallucinationLabelRegistry.GetLabelsInRadius(
|
||||
_playerTransform.position, _labelInfluenceRadius, _labelsInRange);
|
||||
|
||||
float t = _displayedSanity;
|
||||
|
||||
float shakeRadius = Mathf.Lerp(_labelShakeRadiusAtZero, _labelShakeRadiusAtOne, t);
|
||||
float shakeSpeed = Mathf.Lerp(_labelShakeSpeedAtZero, _labelShakeSpeedAtOne, t);
|
||||
float shakeSmoothness = Mathf.Lerp(_labelShakeSmoothnessAtZero, _labelShakeSmoothnessAtOne, t);
|
||||
bool ghostEnabled = t >= 0.5f ? _ghostEnabledAtOne : _ghostEnabledAtZero;
|
||||
float ghostAlpha = Mathf.Lerp(_ghostAlphaMin, _ghostAlphaMax, t);
|
||||
|
||||
foreach (FloatingLabel label in _labelsInRange)
|
||||
{
|
||||
label.ApplyBaseline(shakeRadius, shakeSpeed, shakeSmoothness, ghostEnabled, ghostAlpha);
|
||||
}
|
||||
}
|
||||
|
||||
private void EnsurePlayerTransform()
|
||||
{
|
||||
if (_playerTransform != null) return;
|
||||
if (Unheimlich.Features.Player.PlayerController.Instance != null)
|
||||
_playerTransform = Unheimlich.Features.Player.PlayerController.Instance.transform;
|
||||
else if (Camera.main != null)
|
||||
_playerTransform = Camera.main.transform;
|
||||
}
|
||||
|
||||
// ─── 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);
|
||||
ApplyPostProcessImmediate(_displayedSanity);
|
||||
yield return null;
|
||||
}
|
||||
_displayedSanity = _currentSanity;
|
||||
ApplyPostProcessImmediate(_displayedSanity);
|
||||
_lerpCoroutine = null;
|
||||
}
|
||||
|
||||
// ─── Post-Process 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);
|
||||
|
||||
_hallucinationVolume.weight = 1f;
|
||||
_hallucinationVolume.enabled = true;
|
||||
}
|
||||
|
||||
private void ApplyPostProcessImmediate(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)
|
||||
{
|
||||
_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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6806feb984393b441ad0f1b20cf70333
|
||||
@@ -1,37 +0,0 @@
|
||||
using UnityEngine;
|
||||
using Unheimlich.Core.Audio;
|
||||
|
||||
namespace Unheimlich.Features.Hallucination
|
||||
{
|
||||
/// <summary>
|
||||
/// Fires a hallucination effect when a specific AudioSource plays, finishes, or reaches a timestamp.
|
||||
/// Call OnAudioPlay() from whatever drives the AudioSource to start monitoring.
|
||||
/// </summary>
|
||||
public class HallucinationOnAudio : AudioTriggerBase
|
||||
{
|
||||
[Header("Hallucination Payload")]
|
||||
[Tooltip("Amount of insanity 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;
|
||||
|
||||
protected override void Execute()
|
||||
{
|
||||
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: {HallucinationManager.Instance.SanityLevel:F2}", this);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 57b4beb469df640499f96b38d4fa204b
|
||||
@@ -0,0 +1,121 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.Rendering;
|
||||
|
||||
namespace Unheimlich.Features.Hallucination
|
||||
{
|
||||
/// <summary>
|
||||
/// Drives a persistent post-process weight targeting either a URP/HDRP <see cref="Volume"/>
|
||||
/// and/or a <see cref="Material"/> exposing a <c>_Weight</c> property, based on an
|
||||
/// internal sanity value [0, 1].
|
||||
/// Wire the Wrapper methods to any UnityEvent with no arguments.
|
||||
/// </summary>
|
||||
public class HallucinationPostProcess : MonoBehaviour
|
||||
{
|
||||
[Header("Targets")]
|
||||
[Tooltip("URP/HDRP Volume driven by the sanity weight.")]
|
||||
[SerializeField] private Volume _volume;
|
||||
[Tooltip("Optional material exposing a _Weight property.")]
|
||||
[SerializeField] private Material _shaderMaterial;
|
||||
|
||||
[Header("Sanity")]
|
||||
[SerializeField, Range(0f, 1f)] private float _initialSanity = 0f;
|
||||
[Tooltip("Sanity lost per second after each tween completes. 0 = no decay.")]
|
||||
[SerializeField, Min(0f)] private float _autoDecayRate = 0f;
|
||||
|
||||
[Header("Wrappers")]
|
||||
[Tooltip("Amount added when calling AddSanityWrapper().")]
|
||||
[SerializeField, Range(0f, 1f)] private float _wrapperAddAmount = 0.2f;
|
||||
[Tooltip("Amount removed when calling RemoveSanityWrapper().")]
|
||||
[SerializeField, Range(0f, 1f)] private float _wrapperRemoveAmount = 0.2f;
|
||||
[Tooltip("Transition duration used by all wrappers (seconds).")]
|
||||
[SerializeField, Min(0f)] private float _wrapperDuration = 1f;
|
||||
|
||||
// ─── State ─────────────────────────────────────────────────────────────
|
||||
|
||||
private float _sanity;
|
||||
private int _tweenId = -1;
|
||||
private bool _decaying = false;
|
||||
|
||||
// ─── Lifecycle ─────────────────────────────────────────────────────────
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
_sanity = Mathf.Clamp01(_initialSanity);
|
||||
Apply(_sanity);
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (!_decaying || _autoDecayRate <= 0f || _sanity <= 0f) return;
|
||||
|
||||
_sanity = Mathf.Max(0f, _sanity - _autoDecayRate * Time.deltaTime);
|
||||
Apply(_sanity);
|
||||
|
||||
if (_sanity <= 0f) _decaying = false;
|
||||
}
|
||||
|
||||
// ─── Wrappers ──────────────────────────────────────────────────────────
|
||||
|
||||
/// <summary>Adds <see cref="_wrapperAddAmount"/> sanity over <see cref="_wrapperDuration"/> seconds.
|
||||
/// Auto-decay starts when the tween completes, if <see cref="_autoDecayRate"/> is greater than 0.</summary>
|
||||
public void AddSanityWrapper() => TweenSanity(_sanity + _wrapperAddAmount, _wrapperDuration);
|
||||
|
||||
/// <summary>Removes <see cref="_wrapperRemoveAmount"/> sanity over <see cref="_wrapperDuration"/> seconds.</summary>
|
||||
public void RemoveSanityWrapper() => TweenSanity(_sanity - _wrapperRemoveAmount, _wrapperDuration);
|
||||
|
||||
/// <summary>Snaps sanity to 0 instantly and stops decay.</summary>
|
||||
public void ResetSanityWrapper()
|
||||
{
|
||||
CancelCurrent();
|
||||
_decaying = false;
|
||||
_sanity = 0f;
|
||||
Apply(0f);
|
||||
}
|
||||
|
||||
// ─── Private ───────────────────────────────────────────────────────────
|
||||
|
||||
private void TweenSanity(float target, float duration)
|
||||
{
|
||||
target = Mathf.Clamp01(target);
|
||||
_decaying = false;
|
||||
|
||||
if (duration <= 0f)
|
||||
{
|
||||
CancelCurrent();
|
||||
_sanity = target;
|
||||
Apply(target);
|
||||
if (_autoDecayRate > 0f) _decaying = true;
|
||||
return;
|
||||
}
|
||||
|
||||
CancelCurrent();
|
||||
|
||||
float from = _sanity;
|
||||
_tweenId = LeanTween.value(gameObject, from, target, duration)
|
||||
.setEase(LeanTweenType.easeInOutQuad)
|
||||
.setOnUpdate((float w) =>
|
||||
{
|
||||
_sanity = w;
|
||||
Apply(w);
|
||||
})
|
||||
.setOnComplete(() =>
|
||||
{
|
||||
// Start decay only after the tween has fully completed.
|
||||
if (_autoDecayRate > 0f) _decaying = true;
|
||||
}).id;
|
||||
}
|
||||
|
||||
private void Apply(float weight)
|
||||
{
|
||||
if (_volume != null) _volume.weight = weight;
|
||||
if (_shaderMaterial != null) _shaderMaterial.SetFloat("_Weight", weight);
|
||||
}
|
||||
|
||||
private void CancelCurrent()
|
||||
{
|
||||
if (_tweenId == -1) return;
|
||||
LeanTween.cancel(_tweenId);
|
||||
_tweenId = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8794f9ed5592b56489a289359e19bfed
|
||||
@@ -1,52 +0,0 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace Unheimlich.Features.Hallucination
|
||||
{
|
||||
/// <summary>
|
||||
/// Standalone hallucination payload component.
|
||||
/// Call Trigger() from any external script, UnityEvent, interaction, dialogue callback, etc.
|
||||
/// No other component required alongside it — compose freely.
|
||||
/// </summary>
|
||||
public class HallucinationTrigger : MonoBehaviour
|
||||
{
|
||||
[Header("Sanity")]
|
||||
[Tooltip("Amount of insanity 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;
|
||||
|
||||
/// <summary>
|
||||
/// Fires the hallucination effect.
|
||||
/// Wire this to any UnityEvent, interaction callback, dialogue node event, audio trigger, etc.
|
||||
/// </summary>
|
||||
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. Sanity now: {HallucinationManager.Instance.SanityLevel:F2}", this);
|
||||
}
|
||||
|
||||
if (_hallucinationEvent != null)
|
||||
{
|
||||
HallucinationManager.Instance.TriggerHallucinationEvent(_hallucinationEvent);
|
||||
|
||||
if (_debugMode)
|
||||
Debug.Log($"[HallucinationTrigger] Fired event: {_hallucinationEvent.Label}", this);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5e1119e5c406d0346b0350dbcc91845f
|
||||
@@ -1,66 +0,0 @@
|
||||
using UnityEngine;
|
||||
using Unheimlich.Core.Events;
|
||||
|
||||
namespace Unheimlich.Features.Hallucination
|
||||
{
|
||||
/// <summary>
|
||||
/// Self-contained zone that triggers a hallucination effect when the player enters.
|
||||
/// Ghost-word spawn removed — words live on FloatingLabel components in the scene.
|
||||
/// SetEvent() lets InfiniteStaircaseController inject the right event per slot at runtime.
|
||||
/// </summary>
|
||||
public class HallucinationTriggerZone : TriggerZoneBase
|
||||
{
|
||||
[Header("Zone Behaviour")]
|
||||
[SerializeField] private bool _retriggerable = false;
|
||||
[SerializeField] private float _delay = 0f;
|
||||
|
||||
[Header("Sanity")]
|
||||
[Tooltip("Insanity added when the zone fires, on top of any SanityCost on the event.")]
|
||||
[SerializeField, Range(0f, 1f)] private float _insanityAmount = 0f;
|
||||
|
||||
[Header("Hallucination Event")]
|
||||
[Tooltip("Overridable at runtime via SetEvent().")]
|
||||
[SerializeField] private HallucinationEvent _hallucinationEvent;
|
||||
|
||||
[Header("Debug")]
|
||||
[SerializeField] private bool _debugMode;
|
||||
|
||||
protected override bool IsRetriggerable => _retriggerable;
|
||||
|
||||
protected override void OnPlayerEntered(Collider playerCollider)
|
||||
{
|
||||
if (_delay > 0f) Invoke(nameof(Fire), _delay);
|
||||
else Fire();
|
||||
}
|
||||
|
||||
/// <summary>Overrides the event at runtime. Pass null to disable.</summary>
|
||||
public void SetEvent(HallucinationEvent hallucinationEvent) =>
|
||||
_hallucinationEvent = hallucinationEvent;
|
||||
|
||||
/// <summary>Fires the hallucination. Can be called from external scripts or UnityEvents.</summary>
|
||||
public void Fire()
|
||||
{
|
||||
if (HallucinationManager.Instance == null)
|
||||
{
|
||||
Debug.LogError("[HallucinationTriggerZone] HallucinationManager not found!", this);
|
||||
return;
|
||||
}
|
||||
|
||||
if (_insanityAmount > 0f)
|
||||
{
|
||||
HallucinationManager.Instance.AddInsanity(_insanityAmount);
|
||||
if (_debugMode) Debug.Log($"[HallucinationTriggerZone] +{_insanityAmount:F2} insanity.", this);
|
||||
}
|
||||
|
||||
if (_hallucinationEvent != null)
|
||||
{
|
||||
HallucinationManager.Instance.TriggerHallucinationEvent(_hallucinationEvent);
|
||||
if (_debugMode) Debug.Log($"[HallucinationTriggerZone] Event: {_hallucinationEvent.Label}", this);
|
||||
}
|
||||
else if (_debugMode)
|
||||
{
|
||||
Debug.Log($"[HallucinationTriggerZone] No event on '{gameObject.name}'.", this);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
-2
@@ -1,2 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e8fd091b4319d48448d266a24e885dae
|
||||
@@ -1,26 +0,0 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace Unheimlich.Features.Hallucination
|
||||
{
|
||||
/// <summary>
|
||||
/// DEPRECATED — Ghost word spawning has been removed from the hallucination system.
|
||||
///
|
||||
/// Words are now FloatingLabel components placed directly in the scene (on stair prefabs
|
||||
/// or world props). Their behaviour (shake, ghost trail) is driven at runtime by
|
||||
/// HallucinationManager (baseline, sanity-lerped) and HallucinationEvent (timed overrides).
|
||||
///
|
||||
/// This script is kept as an empty stub so existing scene references don't break.
|
||||
/// It can safely be removed from any GameObject it was attached to.
|
||||
/// </summary>
|
||||
[DisallowMultipleComponent]
|
||||
public class HallucinationWordSpawner : MonoBehaviour
|
||||
{
|
||||
private void Awake()
|
||||
{
|
||||
Debug.LogWarning(
|
||||
"[HallucinationWordSpawner] This component is deprecated and does nothing. " +
|
||||
"Remove it from the scene and use FloatingLabel + HallucinationEvent overrides instead.",
|
||||
this);
|
||||
}
|
||||
}
|
||||
}
|
||||
-2
@@ -1,2 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 39db1c5f2a13bc04782e676a6ad133c8
|
||||
@@ -25,6 +25,7 @@ public class SpiralStaircase : MonoBehaviour
|
||||
public int Turns;
|
||||
public float TotalAngle;
|
||||
[Range(0, 1)] public float Progression;
|
||||
[Range(0, 1)] public float TotalProgression;
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
@@ -43,6 +44,15 @@ public class SpiralStaircase : MonoBehaviour
|
||||
public float Offset = -12.25f;
|
||||
public float StartAngle = 450;
|
||||
public float EndAngle = 720;
|
||||
public float AdditionalTopAngle = 360;
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
public class HallucinationTrigger
|
||||
{
|
||||
[Range(0, 1)] public float Progression;
|
||||
public UnityEvent OnReached;
|
||||
[HideInInspector] public bool Triggered;
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
@@ -51,6 +61,7 @@ public class SpiralStaircase : MonoBehaviour
|
||||
public UnityEvent<bool> OnInside;
|
||||
public UnityEvent OnTopReached;
|
||||
public UnityEvent OnBottomReached;
|
||||
public HallucinationTrigger[] HallucinationTriggers;
|
||||
}
|
||||
|
||||
[SerializeField, OctoReadOnly] private State _state;
|
||||
@@ -60,6 +71,8 @@ public class SpiralStaircase : MonoBehaviour
|
||||
|
||||
private List<IEnumerator> _doorsCoroutine;
|
||||
|
||||
private float _entryAngle = 0f;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
_doorsCoroutine = new List<IEnumerator>();
|
||||
@@ -87,6 +100,7 @@ public class SpiralStaircase : MonoBehaviour
|
||||
|
||||
void OnTriggerEnter(Collider col)
|
||||
{
|
||||
_entryAngle = _state.TotalAngle;
|
||||
if (OctoPlayer.Instance && OctoPlayer.Instance.gameObject == col.gameObject)
|
||||
{
|
||||
if (!_state.PlayerInside)
|
||||
@@ -205,6 +219,23 @@ public class SpiralStaircase : MonoBehaviour
|
||||
|
||||
_state.Progression = progression;
|
||||
|
||||
_state.TotalProgression = Mathf.Clamp01(
|
||||
Mathf.InverseLerp(_entryAngle, _settings.EndAngle + _settings.AdditionalTopAngle, _state.TotalAngle)
|
||||
);
|
||||
|
||||
foreach (var trigger in _events.HallucinationTriggers)
|
||||
{
|
||||
if (!trigger.Triggered && _state.TotalProgression >= trigger.Progression)
|
||||
{
|
||||
trigger.Triggered = true;
|
||||
trigger.OnReached?.Invoke();
|
||||
}
|
||||
else if (trigger.Triggered && _state.TotalProgression < trigger.Progression)
|
||||
{
|
||||
trigger.Triggered = false;
|
||||
}
|
||||
}
|
||||
|
||||
_references.Stairs.transform.localPosition = new Vector3(0, _state.Progression * _settings.Offset, 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -31,8 +31,8 @@ RectTransform:
|
||||
m_LocalScale: {x: 0, y: 0, z: 0}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 5184356617566533976}
|
||||
- {fileID: 7021944921972612920}
|
||||
- {fileID: 4043674246065667140}
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
@@ -103,108 +103,96 @@ MonoBehaviour:
|
||||
m_BlockingMask:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
--- !u!1001 &7301336757621566549
|
||||
PrefabInstance:
|
||||
--- !u!1 &8447621161027149062
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_Modification:
|
||||
serializedVersion: 3
|
||||
m_TransformParent: {fileID: 8886833518829962744}
|
||||
m_Modifications:
|
||||
- target: {fileID: 2495284434525656333, guid: 6fd4dc179de6cf94981d256cdf084bf2, type: 3}
|
||||
propertyPath: m_Pivot.x
|
||||
value: 0.5
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2495284434525656333, guid: 6fd4dc179de6cf94981d256cdf084bf2, type: 3}
|
||||
propertyPath: m_Pivot.y
|
||||
value: 0.5
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2495284434525656333, guid: 6fd4dc179de6cf94981d256cdf084bf2, type: 3}
|
||||
propertyPath: m_AnchorMax.x
|
||||
value: 0.5
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2495284434525656333, guid: 6fd4dc179de6cf94981d256cdf084bf2, type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 0.5
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2495284434525656333, guid: 6fd4dc179de6cf94981d256cdf084bf2, type: 3}
|
||||
propertyPath: m_AnchorMin.x
|
||||
value: 0.5
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2495284434525656333, guid: 6fd4dc179de6cf94981d256cdf084bf2, type: 3}
|
||||
propertyPath: m_AnchorMin.y
|
||||
value: 0.5
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2495284434525656333, guid: 6fd4dc179de6cf94981d256cdf084bf2, type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 100
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2495284434525656333, guid: 6fd4dc179de6cf94981d256cdf084bf2, type: 3}
|
||||
propertyPath: m_SizeDelta.y
|
||||
value: 100
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2495284434525656333, guid: 6fd4dc179de6cf94981d256cdf084bf2, type: 3}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2495284434525656333, guid: 6fd4dc179de6cf94981d256cdf084bf2, type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2495284434525656333, guid: 6fd4dc179de6cf94981d256cdf084bf2, type: 3}
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2495284434525656333, guid: 6fd4dc179de6cf94981d256cdf084bf2, type: 3}
|
||||
propertyPath: m_LocalRotation.w
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2495284434525656333, guid: 6fd4dc179de6cf94981d256cdf084bf2, type: 3}
|
||||
propertyPath: m_LocalRotation.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2495284434525656333, guid: 6fd4dc179de6cf94981d256cdf084bf2, type: 3}
|
||||
propertyPath: m_LocalRotation.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2495284434525656333, guid: 6fd4dc179de6cf94981d256cdf084bf2, type: 3}
|
||||
propertyPath: m_LocalRotation.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2495284434525656333, guid: 6fd4dc179de6cf94981d256cdf084bf2, type: 3}
|
||||
propertyPath: m_AnchoredPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2495284434525656333, guid: 6fd4dc179de6cf94981d256cdf084bf2, type: 3}
|
||||
propertyPath: m_AnchoredPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2495284434525656333, guid: 6fd4dc179de6cf94981d256cdf084bf2, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2495284434525656333, guid: 6fd4dc179de6cf94981d256cdf084bf2, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2495284434525656333, guid: 6fd4dc179de6cf94981d256cdf084bf2, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3736995870599774548, guid: 6fd4dc179de6cf94981d256cdf084bf2, type: 3}
|
||||
propertyPath: m_Name
|
||||
value: Crosshair
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_RemovedGameObjects: []
|
||||
m_AddedGameObjects: []
|
||||
m_AddedComponents: []
|
||||
m_SourcePrefab: {fileID: 100100000, guid: 6fd4dc179de6cf94981d256cdf084bf2, type: 3}
|
||||
--- !u!224 &5184356617566533976 stripped
|
||||
RectTransform:
|
||||
m_CorrespondingSourceObject: {fileID: 2495284434525656333, guid: 6fd4dc179de6cf94981d256cdf084bf2, type: 3}
|
||||
m_PrefabInstance: {fileID: 7301336757621566549}
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 4043674246065667140}
|
||||
- component: {fileID: 6305877997792785643}
|
||||
- component: {fileID: 8036775480842771334}
|
||||
- component: {fileID: 6197325093082392848}
|
||||
m_Layer: 0
|
||||
m_Name: HallucinationFlash
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &4043674246065667140
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8447621161027149062}
|
||||
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: 8886833518829962744}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &6305877997792785643
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8447621161027149062}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 3aa8c513a3632aa4aa3b8ca2da6ca926, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: Assembly-CSharp::Unheimlich.Features.Hallucination.HallucinationFlash
|
||||
_image: {fileID: 0}
|
||||
_defaultEvent: {fileID: 0}
|
||||
--- !u!222 &8036775480842771334
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8447621161027149062}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &6197325093082392848
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8447621161027149062}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.Image
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 0.5283019, g: 0.021597153, b: 0.021597153, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: 0}
|
||||
m_Type: 0
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 4
|
||||
m_FillAmount: 1
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
--- !u!1001 &8829556081253035945
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
|
||||
Reference in New Issue
Block a user