From a2aa91e80d13194552ee2d9fedf185eebc8e77ad Mon Sep 17 00:00:00 2001 From: yauwailam Date: Fri, 14 Feb 2025 12:32:11 +0800 Subject: [PATCH] Revert "trying to add effects to day 2 town but its not workinggg" This reverts commit 3cb32e304d08132235cc411b29a8d28d2fcf594f. --- Game/Assets/Scenes/Town.unity | 518 +++++++++++++++---- Game/Assets/Scripts/BroomSweeping.cs | 2 +- Game/Assets/Scripts/GoToSchool.cs | 33 -- Game/Assets/Scripts/PostProcessingManager.cs | 2 +- 4 files changed, 408 insertions(+), 147 deletions(-) diff --git a/Game/Assets/Scenes/Town.unity b/Game/Assets/Scenes/Town.unity index 2f3d41d..d3eda4f 100644 --- a/Game/Assets/Scenes/Town.unity +++ b/Game/Assets/Scenes/Town.unity @@ -15570,6 +15570,7 @@ GameObject: serializedVersion: 6 m_Component: - component: {fileID: 93426465} + - component: {fileID: 93426466} - component: {fileID: 93426467} m_Layer: 0 m_Name: Post Processing Manager @@ -15593,6 +15594,44 @@ Transform: m_Children: [] m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &93426466 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 93426464} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4e25f510b8cc01f4e8a29b3995d1bde9, type: 3} + m_Name: + m_EditorClassIdentifier: + postProcessingVolume: {fileID: 1297863892} + intensityCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 2 + outSlope: 2 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.48768392 + value: 0.0054833516 + inSlope: -7.5780034 + outSlope: -7.5780034 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.057496972 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + cycleDuration: 3 --- !u!114 &93426467 MonoBehaviour: m_ObjectHideFlags: 0 @@ -15605,129 +15644,39 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 46e96ab748a3a844f9137261de774bfe, type: 3} m_Name: m_EditorClassIdentifier: - volume: {fileID: 1297863892} + volume: {fileID: 0} vignetteIntensity: serializedVersion: 2 - m_Curve: - - serializedVersion: 3 - time: 0 - value: 0 - inSlope: 2 - outSlope: 2 - tangentMode: 0 - weightedMode: 0 - inWeight: 0 - outWeight: 0 - - serializedVersion: 3 - time: 0.9791565 - value: 0.0070762634 - inSlope: -1.7419676 - outSlope: -1.7419676 - tangentMode: 0 - weightedMode: 0 - inWeight: 0.05530932 - outWeight: 0 - m_PreInfinity: 1 - m_PostInfinity: 1 + m_Curve: [] + m_PreInfinity: 2 + m_PostInfinity: 2 m_RotationOrder: 4 chromaticAberrationIntensity: serializedVersion: 2 - m_Curve: - - serializedVersion: 3 - time: 0 - value: 0 - inSlope: 2 - outSlope: 2 - tangentMode: 0 - weightedMode: 0 - inWeight: 0 - outWeight: 0 - - serializedVersion: 3 - time: 0.9833374 - value: 0.011791229 - inSlope: -1.5093689 - outSlope: -1.5093689 - tangentMode: 0 - weightedMode: 0 - inWeight: 0.07627498 - outWeight: 0 - m_PreInfinity: 1 - m_PostInfinity: 1 + m_Curve: [] + m_PreInfinity: 2 + m_PostInfinity: 2 m_RotationOrder: 4 motionBlurIntensity: serializedVersion: 2 - m_Curve: - - serializedVersion: 3 - time: 0 - value: 0 - inSlope: 2 - outSlope: 2 - tangentMode: 0 - weightedMode: 0 - inWeight: 0 - outWeight: 0 - - serializedVersion: 3 - time: 0.975 - value: 0.018867925 - inSlope: -1.7610052 - outSlope: -1.7610052 - tangentMode: 0 - weightedMode: 0 - inWeight: 0.038461562 - outWeight: 0 - m_PreInfinity: 1 - m_PostInfinity: 1 + m_Curve: [] + m_PreInfinity: 2 + m_PostInfinity: 2 m_RotationOrder: 4 lensDistortionIntensity: serializedVersion: 2 - m_Curve: - - serializedVersion: 3 - time: 0 - value: 0 - inSlope: 2 - outSlope: 2 - tangentMode: 0 - weightedMode: 0 - inWeight: 0 - outWeight: 0 - - serializedVersion: 3 - time: 0.9666748 - value: 0.011791229 - inSlope: -1.4714406 - outSlope: -1.4714406 - tangentMode: 0 - weightedMode: 0 - inWeight: 0.043111492 - outWeight: 0 - m_PreInfinity: 1 - m_PostInfinity: 1 + m_Curve: [] + m_PreInfinity: 2 + m_PostInfinity: 2 m_RotationOrder: 4 colorAdjustmentsIntensity: serializedVersion: 2 - m_Curve: - - serializedVersion: 3 - time: 0.0041656494 - value: 0 - inSlope: 2 - outSlope: 2 - tangentMode: 0 - weightedMode: 0 - inWeight: 0 - outWeight: 0 - - serializedVersion: 3 - time: 0.9833374 - value: 0.0070762634 - inSlope: -1.3088709 - outSlope: -1.3088709 - tangentMode: 0 - weightedMode: 0 - inWeight: 0.06780045 - outWeight: 0 - m_PreInfinity: 1 - m_PostInfinity: 1 + m_Curve: [] + m_PreInfinity: 2 + m_PostInfinity: 2 m_RotationOrder: 4 - audioSource: {fileID: 205722625} - heartbeatSound: {fileID: 8300000, guid: 707a31d71d56cc648bbbe78a4bba9e5c, type: 3} + audioSource: {fileID: 0} + heartbeatSound: {fileID: 0} whisperSound: {fileID: 0} distortedWhisperSound: {fileID: 0} --- !u!43 &93585783 @@ -17770,6 +17719,140 @@ Mesh: offset: 0 size: 0 path: +--- !u!1 &104995264 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 104995265} + - component: {fileID: 104995267} + - component: {fileID: 104995266} + m_Layer: 5 + m_Name: Text (TMP) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &104995265 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 104995264} + 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: 776132478} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 370, y: 181} + m_SizeDelta: {x: 200, y: 50} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &104995266 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 104995264} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, 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_text: Test + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4294967295 + m_fontColor: {r: 1, g: 1, b: 1, a: 1} + m_enableVertexGradient: 0 + m_colorMode: 3 + m_fontColorGradient: + topLeft: {r: 1, g: 1, b: 1, a: 1} + topRight: {r: 1, g: 1, b: 1, a: 1} + bottomLeft: {r: 1, g: 1, b: 1, a: 1} + bottomRight: {r: 1, g: 1, b: 1, a: 1} + m_fontColorGradientPreset: {fileID: 0} + m_spriteAsset: {fileID: 0} + m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 + m_overrideHtmlColors: 0 + m_faceColor: + serializedVersion: 2 + rgba: 4294967295 + m_fontSize: 16 + m_fontSizeBase: 16 + m_fontWeight: 400 + m_enableAutoSizing: 0 + m_fontSizeMin: 18 + m_fontSizeMax: 72 + m_fontStyle: 0 + m_HorizontalAlignment: 4 + m_VerticalAlignment: 256 + m_textAlignment: 65535 + m_characterSpacing: 0 + m_wordSpacing: 0 + m_lineSpacing: 0 + m_lineSpacingMax: 0 + m_paragraphSpacing: 0 + m_charWidthMaxAdj: 0 + m_enableWordWrapping: 1 + m_wordWrappingRatios: 0.4 + m_overflowMode: 0 + m_linkedTextComponent: {fileID: 0} + parentLinkedComponent: {fileID: 0} + m_enableKerning: 1 + m_enableExtraPadding: 0 + checkPaddingRequired: 0 + m_isRichText: 1 + m_parseCtrlCharacters: 1 + m_isOrthographic: 1 + m_isCullingEnabled: 0 + m_horizontalMapping: 0 + m_verticalMapping: 0 + m_uvLineOffset: 0 + m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 + m_VertexBufferAutoSizeReduction: 0 + m_useMaxVisibleDescender: 1 + m_pageToDisplay: 1 + m_margin: {x: -231.23126, y: 0, z: 116.85144, w: -79.70676} + m_isUsingLegacyAnimationComponent: 0 + m_isVolumetricText: 0 + m_hasFontAssetChanged: 0 + m_baseMaterial: {fileID: 0} + m_maskOffset: {x: 0, y: 0, z: 0, w: 0} +--- !u!222 &104995267 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 104995264} + m_CullTransparentMesh: 1 --- !u!43 &105587239 Mesh: m_ObjectHideFlags: 0 @@ -146311,6 +146394,82 @@ MonoBehaviour: m_SelectedFaces: m_SelectedEdges: [] m_SelectedVertices: +--- !u!1 &776132477 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 776132478} + - component: {fileID: 776132480} + - component: {fileID: 776132479} + m_Layer: 5 + m_Name: Info Collecting + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &776132478 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 776132477} + 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: 104995265} + m_Father: {fileID: 931094981} + 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 &776132479 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 776132477} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 0} + 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: 10907, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 + 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 &776132480 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 776132477} + m_CullTransparentMesh: 1 --- !u!43 &776938236 Mesh: m_ObjectHideFlags: 0 @@ -178348,6 +178507,8 @@ RectTransform: m_LocalScale: {x: 0, y: 0, z: 0} m_ConstrainProportionsScale: 0 m_Children: + - {fileID: 776132478} + - {fileID: 1258227768} - {fileID: 1431178181} m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -238187,6 +238348,140 @@ Mesh: offset: 0 size: 0 path: +--- !u!1 &1258227767 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1258227768} + - component: {fileID: 1258227770} + - component: {fileID: 1258227769} + m_Layer: 5 + m_Name: Crosshair + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1258227768 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1258227767} + 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: 931094981} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 200, y: 50} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1258227769 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1258227767} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, 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_text: + + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4294967295 + m_fontColor: {r: 1, g: 1, b: 1, a: 1} + m_enableVertexGradient: 0 + m_colorMode: 3 + m_fontColorGradient: + topLeft: {r: 1, g: 1, b: 1, a: 1} + topRight: {r: 1, g: 1, b: 1, a: 1} + bottomLeft: {r: 1, g: 1, b: 1, a: 1} + bottomRight: {r: 1, g: 1, b: 1, a: 1} + m_fontColorGradientPreset: {fileID: 0} + m_spriteAsset: {fileID: 0} + m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 + m_overrideHtmlColors: 0 + m_faceColor: + serializedVersion: 2 + rgba: 4294967295 + m_fontSize: 16 + m_fontSizeBase: 16 + m_fontWeight: 400 + m_enableAutoSizing: 0 + m_fontSizeMin: 18 + m_fontSizeMax: 72 + m_fontStyle: 0 + m_HorizontalAlignment: 2 + m_VerticalAlignment: 512 + m_textAlignment: 65535 + m_characterSpacing: 0 + m_wordSpacing: 0 + m_lineSpacing: 0 + m_lineSpacingMax: 0 + m_paragraphSpacing: 0 + m_charWidthMaxAdj: 0 + m_enableWordWrapping: 1 + m_wordWrappingRatios: 0.4 + m_overflowMode: 0 + m_linkedTextComponent: {fileID: 0} + parentLinkedComponent: {fileID: 0} + m_enableKerning: 1 + m_enableExtraPadding: 0 + checkPaddingRequired: 0 + m_isRichText: 1 + m_parseCtrlCharacters: 1 + m_isOrthographic: 1 + m_isCullingEnabled: 0 + m_horizontalMapping: 0 + m_verticalMapping: 0 + m_uvLineOffset: 0 + m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 + m_VertexBufferAutoSizeReduction: 0 + m_useMaxVisibleDescender: 1 + m_pageToDisplay: 1 + m_margin: {x: 0, y: 0, z: 0, w: 0} + m_isUsingLegacyAnimationComponent: 0 + m_isVolumetricText: 0 + m_hasFontAssetChanged: 0 + m_baseMaterial: {fileID: 0} + m_maskOffset: {x: 0, y: 0, z: 0, w: 0} +--- !u!222 &1258227770 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1258227767} + m_CullTransparentMesh: 1 --- !u!43 &1260770911 Mesh: m_ObjectHideFlags: 0 @@ -245369,7 +245664,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!114 &1297863892 MonoBehaviour: m_ObjectHideFlags: 0 @@ -246660,7 +246955,7 @@ Transform: m_GameObject: {fileID: 1305339137} serializedVersion: 2 m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 62.5, y: 20.39, z: 1071.3} + m_LocalPosition: {x: 62.5, y: 20.33, z: 1071.3} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] @@ -254548,7 +254843,6 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: efcd661891d8a6b48b0cae6b4b9b0d51, type: 3} m_Name: m_EditorClassIdentifier: - postProcessingManager: {fileID: 93426467} fadeCanvasGroup: {fileID: 536676154} fadeDuration: 1 displayDuration: 3 @@ -338112,7 +338406,7 @@ BoxCollider: serializedVersion: 2 m_Bits: 0 m_LayerOverridePriority: 0 - m_IsTrigger: 1 + m_IsTrigger: 0 m_ProvidesContacts: 0 m_Enabled: 1 serializedVersion: 3 diff --git a/Game/Assets/Scripts/BroomSweeping.cs b/Game/Assets/Scripts/BroomSweeping.cs index 932cfad..26bc643 100644 --- a/Game/Assets/Scripts/BroomSweeping.cs +++ b/Game/Assets/Scripts/BroomSweeping.cs @@ -12,7 +12,7 @@ using TMPro; public class BroomSweeping : MonoBehaviour { private GameManager gameManager; - private PostProcessingManager PostProcessingManager; + private PostProcessingManager postProcessingManager; // To track how much trash has been collected so far public int dirtSweeped = 0; diff --git a/Game/Assets/Scripts/GoToSchool.cs b/Game/Assets/Scripts/GoToSchool.cs index d26e43e..8d85827 100644 --- a/Game/Assets/Scripts/GoToSchool.cs +++ b/Game/Assets/Scripts/GoToSchool.cs @@ -12,7 +12,6 @@ using UnityEngine.SceneManagement; public class GoToSchool : MonoBehaviour { private GameManager gameManager; - public PostProcessingManager postProcessingManager; public CanvasGroup fadeCanvasGroup; // Assign in Inspector public float fadeDuration = 1f; // Duration for fade in/out @@ -38,13 +37,6 @@ public class GoToSchool : MonoBehaviour public ResetPosition xrRig; void Awake() { - if (postProcessingManager == null) - { - postProcessingManager = FindObjectOfType(); - } - - SceneManager.sceneLoaded += OnSceneLoaded; // Subscribe to scene loaded event - Debug.Log("IM AWAKE"); // DontDestroyOnLoad(gameObject); gameManager = GameManager.Instance; // Reference to GameManager instance @@ -86,33 +78,9 @@ public class GoToSchool : MonoBehaviour effect.Play(); // Play each particle system } - PostProcessingManager.Instance.TriggerEffect("Panic"); } } - void OnDestroy() - { - SceneManager.sceneLoaded -= OnSceneLoaded; // Unsubscribe to prevent memory leaks - } - - IEnumerator WaitAndFindPostProcessing() - { - yield return new WaitForSeconds(0.1f); // Small delay to ensure scene objects are initialized - postProcessingManager = FindObjectOfType(); - - if (postProcessingManager == null) - { - Debug.LogError("PostProcessingManager still not found!"); - } - else - { - Debug.Log("PostProcessingManager found after delay."); - } - } - void OnSceneLoaded(Scene scene, LoadSceneMode mode) - { - StartCoroutine(WaitAndFindPostProcessing()); - } private IEnumerator ClearMessageAfterSeconds(float delay) { @@ -153,7 +121,6 @@ public class GoToSchool : MonoBehaviour { storyText.text = "The sound of the water is soothing..."; yield return new WaitForSeconds(7f); - PostProcessingManager.Instance.StopEffect(); storyText.text = "I feel a little better now. I should head to school now."; StartCoroutine(ClearMessageAfterSeconds(7f)); } diff --git a/Game/Assets/Scripts/PostProcessingManager.cs b/Game/Assets/Scripts/PostProcessingManager.cs index 73a949b..462f57c 100644 --- a/Game/Assets/Scripts/PostProcessingManager.cs +++ b/Game/Assets/Scripts/PostProcessingManager.cs @@ -12,7 +12,7 @@ using UnityEngine.Rendering.Universal; public class PostProcessingManager : MonoBehaviour { - public static PostProcessingManager Instance { get; private set; } + public static PostProcessingManager Instance; // Defines the Global Volume public Volume volume;