From f26d5a874163366ac4945bcc64f8d316352d3f6a Mon Sep 17 00:00:00 2001 From: Ali Sharoz Date: Thu, 28 Nov 2024 12:15:47 +0500 Subject: [PATCH] Bug fix --- .../Testing/Testing_PushWin.cs | 4 +- .../3rd/D2D_Scripts/Testing/CheatConsole.cs | 3 +- Assets/Scenes/Gameplay.unity | 173 +++++++++--------- Assets/Scripts/Dev/GameManager.cs | 2 +- Assets/Source/Scripts/GameProgress.cs | 5 +- 5 files changed, 96 insertions(+), 91 deletions(-) diff --git a/Assets/3rd/D2D_Scripts/Core/GameStateMachine/Testing/Testing_PushWin.cs b/Assets/3rd/D2D_Scripts/Core/GameStateMachine/Testing/Testing_PushWin.cs index 044feae2..46663fa8 100644 --- a/Assets/3rd/D2D_Scripts/Core/GameStateMachine/Testing/Testing_PushWin.cs +++ b/Assets/3rd/D2D_Scripts/Core/GameStateMachine/Testing/Testing_PushWin.cs @@ -18,8 +18,8 @@ namespace D2D { private async UniTaskVoid Start() { - await 1f.Seconds(); - GameManager.Instance.LevelCompleteParticleEffectObj.Play(true); + await 1f.Seconds(); GameManager.Instance.LevelCompleteParticleEffectObj.SetActive(true); + _stateMachine.Push(new WinState(),false,true); } diff --git a/Assets/3rd/D2D_Scripts/Testing/CheatConsole.cs b/Assets/3rd/D2D_Scripts/Testing/CheatConsole.cs index 928c6d3a..bfc6d9d4 100644 --- a/Assets/3rd/D2D_Scripts/Testing/CheatConsole.cs +++ b/Assets/3rd/D2D_Scripts/Testing/CheatConsole.cs @@ -33,7 +33,8 @@ namespace D2D [Button("Win")] private void PushWin() { - GameManager.Instance.LevelCompleteParticleEffectObj.Play(true); + GameManager.Instance.LevelCompleteParticleEffectObj.SetActive(true); + _stateMachine.Push(new WinState(), false, true); } diff --git a/Assets/Scenes/Gameplay.unity b/Assets/Scenes/Gameplay.unity index aac7a572..cf633fd5 100644 --- a/Assets/Scenes/Gameplay.unity +++ b/Assets/Scenes/Gameplay.unity @@ -70550,6 +70550,81 @@ MeshFilter: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 767527337} m_Mesh: {fileID: 5729834915169305720, guid: 8d8a929ae8eed984386087e028b124fc, type: 3} +--- !u!1001 &769297779 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 831540594} + m_Modifications: + - target: {fileID: 409766307384202603, guid: 8bba6ce67b7dc4f57a017d0bd38958d6, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 409766307384202603, guid: 8bba6ce67b7dc4f57a017d0bd38958d6, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 409766307384202603, guid: 8bba6ce67b7dc4f57a017d0bd38958d6, type: 3} + propertyPath: m_LocalPosition.z + value: 7 + objectReference: {fileID: 0} + - target: {fileID: 409766307384202603, guid: 8bba6ce67b7dc4f57a017d0bd38958d6, type: 3} + propertyPath: m_LocalRotation.w + value: 0.7071068 + objectReference: {fileID: 0} + - target: {fileID: 409766307384202603, guid: 8bba6ce67b7dc4f57a017d0bd38958d6, type: 3} + propertyPath: m_LocalRotation.x + value: -0.7071068 + objectReference: {fileID: 0} + - target: {fileID: 409766307384202603, guid: 8bba6ce67b7dc4f57a017d0bd38958d6, type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 409766307384202603, guid: 8bba6ce67b7dc4f57a017d0bd38958d6, type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 409766307384202603, guid: 8bba6ce67b7dc4f57a017d0bd38958d6, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 409766307384202603, guid: 8bba6ce67b7dc4f57a017d0bd38958d6, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 409766307384202603, guid: 8bba6ce67b7dc4f57a017d0bd38958d6, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 412169348722089053, guid: 8bba6ce67b7dc4f57a017d0bd38958d6, type: 3} + propertyPath: m_Name + value: Firework_FastPooled + objectReference: {fileID: 0} + - target: {fileID: 412169348722089053, guid: 8bba6ce67b7dc4f57a017d0bd38958d6, type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 540322352524163837, guid: 8bba6ce67b7dc4f57a017d0bd38958d6, type: 3} + propertyPath: looping + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 8bba6ce67b7dc4f57a017d0bd38958d6, type: 3} +--- !u!1 &769297780 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 412169348722089053, guid: 8bba6ce67b7dc4f57a017d0bd38958d6, type: 3} + m_PrefabInstance: {fileID: 769297779} + m_PrefabAsset: {fileID: 0} +--- !u!4 &769297781 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 409766307384202603, guid: 8bba6ce67b7dc4f57a017d0bd38958d6, type: 3} + m_PrefabInstance: {fileID: 769297779} + m_PrefabAsset: {fileID: 0} --- !u!1 &769547693 GameObject: m_ObjectHideFlags: 0 @@ -76779,6 +76854,11 @@ MeshFilter: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 829038228} m_Mesh: {fileID: -3574712139116870614, guid: 87cd0815b8b9731418cb25b3f90e1e3b, type: 3} +--- !u!4 &831540594 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 8270126656302349907, guid: 2afb0c0b1e9834310869cb2f0c994844, type: 3} + m_PrefabInstance: {fileID: 1912088910611789087} + m_PrefabAsset: {fileID: 0} --- !u!1 &833935812 GameObject: m_ObjectHideFlags: 0 @@ -125326,89 +125406,6 @@ Transform: - {fileID: 643924014} m_Father: {fileID: 1440717090} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!1001 &1414093249 -PrefabInstance: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - serializedVersion: 3 - m_TransformParent: {fileID: 0} - m_Modifications: - - target: {fileID: 409766307384202603, guid: 8bba6ce67b7dc4f57a017d0bd38958d6, type: 3} - propertyPath: m_LocalPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 409766307384202603, guid: 8bba6ce67b7dc4f57a017d0bd38958d6, type: 3} - propertyPath: m_LocalPosition.y - value: 3.53 - objectReference: {fileID: 0} - - target: {fileID: 409766307384202603, guid: 8bba6ce67b7dc4f57a017d0bd38958d6, type: 3} - propertyPath: m_LocalPosition.z - value: -0 - objectReference: {fileID: 0} - - target: {fileID: 409766307384202603, guid: 8bba6ce67b7dc4f57a017d0bd38958d6, type: 3} - propertyPath: m_LocalRotation.w - value: 0.7071068 - objectReference: {fileID: 0} - - target: {fileID: 409766307384202603, guid: 8bba6ce67b7dc4f57a017d0bd38958d6, type: 3} - propertyPath: m_LocalRotation.x - value: -0.7071068 - objectReference: {fileID: 0} - - target: {fileID: 409766307384202603, guid: 8bba6ce67b7dc4f57a017d0bd38958d6, type: 3} - propertyPath: m_LocalRotation.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 409766307384202603, guid: 8bba6ce67b7dc4f57a017d0bd38958d6, type: 3} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 409766307384202603, guid: 8bba6ce67b7dc4f57a017d0bd38958d6, type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: -90 - objectReference: {fileID: 0} - - target: {fileID: 409766307384202603, guid: 8bba6ce67b7dc4f57a017d0bd38958d6, type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 409766307384202603, guid: 8bba6ce67b7dc4f57a017d0bd38958d6, type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 412169348722089053, guid: 8bba6ce67b7dc4f57a017d0bd38958d6, type: 3} - propertyPath: m_Name - value: Firework_FastPooled - objectReference: {fileID: 0} - - target: {fileID: 412169348722089053, guid: 8bba6ce67b7dc4f57a017d0bd38958d6, type: 3} - propertyPath: m_IsActive - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 413991725820021211, guid: 8bba6ce67b7dc4f57a017d0bd38958d6, type: 3} - propertyPath: playOnAwake - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 413991725820050167, guid: 8bba6ce67b7dc4f57a017d0bd38958d6, type: 3} - propertyPath: playOnAwake - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 540322352524163837, guid: 8bba6ce67b7dc4f57a017d0bd38958d6, type: 3} - propertyPath: looping - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 540322352524163837, guid: 8bba6ce67b7dc4f57a017d0bd38958d6, type: 3} - propertyPath: playOnAwake - value: 0 - objectReference: {fileID: 0} - m_RemovedComponents: - - {fileID: 1418601364, guid: 8bba6ce67b7dc4f57a017d0bd38958d6, type: 3} - m_RemovedGameObjects: [] - m_AddedGameObjects: [] - m_AddedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: 8bba6ce67b7dc4f57a017d0bd38958d6, type: 3} ---- !u!1 &1414093250 stripped -GameObject: - m_CorrespondingSourceObject: {fileID: 412169348722089053, guid: 8bba6ce67b7dc4f57a017d0bd38958d6, type: 3} - m_PrefabInstance: {fileID: 1414093249} - m_PrefabAsset: {fileID: 0} --- !u!1 &1414277186 GameObject: m_ObjectHideFlags: 0 @@ -189183,7 +189180,7 @@ PrefabInstance: - target: {fileID: 210116023425839573, guid: 2afb0c0b1e9834310869cb2f0c994844, type: 3} propertyPath: LevelCompleteParticleEffectObj value: - objectReference: {fileID: 1414093250} + objectReference: {fileID: 769297780} - target: {fileID: 450773179923285749, guid: 2afb0c0b1e9834310869cb2f0c994844, type: 3} propertyPath: m_SizeDelta.x value: 650 @@ -190072,6 +190069,10 @@ PrefabInstance: propertyPath: m_Name value: Fire objectReference: {fileID: 0} + - target: {fileID: 8600940034121060075, guid: 2afb0c0b1e9834310869cb2f0c994844, type: 3} + propertyPath: m_IsActive + value: 1 + objectReference: {fileID: 0} - target: {fileID: 8603563005481145159, guid: 2afb0c0b1e9834310869cb2f0c994844, type: 3} propertyPath: m_IsActive value: 1 @@ -190147,6 +190148,9 @@ PrefabInstance: - targetCorrespondingSourceObject: {fileID: 191765603611759466, guid: 2afb0c0b1e9834310869cb2f0c994844, type: 3} insertIndex: -1 addedObject: {fileID: 655829003} + - targetCorrespondingSourceObject: {fileID: 8270126656302349907, guid: 2afb0c0b1e9834310869cb2f0c994844, type: 3} + insertIndex: -1 + addedObject: {fileID: 769297781} m_AddedComponents: - targetCorrespondingSourceObject: {fileID: 9210140489432102636, guid: 2afb0c0b1e9834310869cb2f0c994844, type: 3} insertIndex: -1 @@ -190809,5 +190813,4 @@ SceneRoots: - {fileID: 1587148440} - {fileID: 1688528664} - {fileID: 1790654131} - - {fileID: 1414093249} - {fileID: 503521024} diff --git a/Assets/Scripts/Dev/GameManager.cs b/Assets/Scripts/Dev/GameManager.cs index 412c922d..64510895 100644 --- a/Assets/Scripts/Dev/GameManager.cs +++ b/Assets/Scripts/Dev/GameManager.cs @@ -6,7 +6,7 @@ using UnityEngine; public class GameManager : MonoBehaviour { public static GameManager Instance = null; - public ParticleSystem LevelCompleteParticleEffectObj; + public GameObject LevelCompleteParticleEffectObj; private void Awake() { //if (Instance is null) diff --git a/Assets/Source/Scripts/GameProgress.cs b/Assets/Source/Scripts/GameProgress.cs index e67c1ff0..d525f6e5 100644 --- a/Assets/Source/Scripts/GameProgress.cs +++ b/Assets/Source/Scripts/GameProgress.cs @@ -115,7 +115,7 @@ public class GameProgress : GameStateMachineUser if (levelTime >= _levelSO.TotalDuration) { - GameManager.Instance.LevelCompleteParticleEffectObj.Play(true); + GameManager.Instance.LevelCompleteParticleEffectObj.SetActive(true); _stateMachine.Push(new WinState(), false, true); } @@ -159,7 +159,8 @@ public class GameProgress : GameStateMachineUser if (totalXP >= needToFinish) { - GameManager.Instance.LevelCompleteParticleEffectObj.Play(true); + GameManager.Instance.LevelCompleteParticleEffectObj.SetActive(true); + _stateMachine.Push(new WinState(), false, true); } }