From 75c15cf26522cbdfaa6992c33741f3a0855abfca Mon Sep 17 00:00:00 2001 From: Ali Sharoz Date: Tue, 26 Nov 2024 17:31:32 +0500 Subject: [PATCH] Bug Fix --- .../3rd/D2D_Scripts/Gameplay/Health/Health.cs | 3 ++- .../D2D_Scripts/UI/SetActivityOnGameState.cs | 1 + Assets/Revival.cs | 18 ++++++++++++++++++ Assets/Revival.cs.meta | 11 +++++++++++ Assets/Scenes/Gameplay.unity | 15 +++++++++++++++ Assets/Scripts/Dev/ReviveOnClick.cs | 10 +++++----- Assets/Source/Scripts/GameProgress.cs | 6 ++++++ 7 files changed, 58 insertions(+), 6 deletions(-) create mode 100644 Assets/Revival.cs create mode 100644 Assets/Revival.cs.meta diff --git a/Assets/3rd/D2D_Scripts/Gameplay/Health/Health.cs b/Assets/3rd/D2D_Scripts/Gameplay/Health/Health.cs index cd80c8dc..5a4ab878 100644 --- a/Assets/3rd/D2D_Scripts/Gameplay/Health/Health.cs +++ b/Assets/3rd/D2D_Scripts/Gameplay/Health/Health.cs @@ -156,7 +156,8 @@ namespace D2D.Gameplay IEnumerator DeathCoroutine() { - yield return new WaitForSeconds(10f); + yield return new WaitForSeconds(6f); + GameManager.Instance.OnRevival(); InitiateDeathSequence(); } diff --git a/Assets/3rd/D2D_Scripts/UI/SetActivityOnGameState.cs b/Assets/3rd/D2D_Scripts/UI/SetActivityOnGameState.cs index 697b267f..8a96f908 100644 --- a/Assets/3rd/D2D_Scripts/UI/SetActivityOnGameState.cs +++ b/Assets/3rd/D2D_Scripts/UI/SetActivityOnGameState.cs @@ -26,6 +26,7 @@ namespace D2D private void Show(GameObject[] parent) { + Debug.Log("Show: " + parent[0].gameObject.name); if (parent.IsNullOrEmpty()) return; diff --git a/Assets/Revival.cs b/Assets/Revival.cs new file mode 100644 index 00000000..5e64c00a --- /dev/null +++ b/Assets/Revival.cs @@ -0,0 +1,18 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class Revival : MonoBehaviour +{ + // Start is called before the first frame update + void Start() + { + + } + + // Update is called once per frame + void Update() + { + + } +} diff --git a/Assets/Revival.cs.meta b/Assets/Revival.cs.meta new file mode 100644 index 00000000..3807c1b6 --- /dev/null +++ b/Assets/Revival.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1677ce6e50690ff40aba4417257c6136 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scenes/Gameplay.unity b/Assets/Scenes/Gameplay.unity index 14144e19..aa660c72 100644 --- a/Assets/Scenes/Gameplay.unity +++ b/Assets/Scenes/Gameplay.unity @@ -61640,6 +61640,18 @@ MonoBehaviour: m_StringArgument: m_BoolArgument: 0 m_CallState: 2 +--- !u!114 &671232094 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 671232090} + m_Enabled: 0 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1677ce6e50690ff40aba4417257c6136, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!1 &671891082 GameObject: m_ObjectHideFlags: 0 @@ -190022,6 +190034,9 @@ PrefabInstance: - targetCorrespondingSourceObject: {fileID: 9210140489432102636, guid: 2afb0c0b1e9834310869cb2f0c994844, type: 3} insertIndex: -1 addedObject: {fileID: 671232093} + - targetCorrespondingSourceObject: {fileID: 9210140489432102636, guid: 2afb0c0b1e9834310869cb2f0c994844, type: 3} + insertIndex: -1 + addedObject: {fileID: 671232094} m_SourcePrefab: {fileID: 100100000, guid: 2afb0c0b1e9834310869cb2f0c994844, type: 3} --- !u!224 &1912088910611789088 stripped RectTransform: diff --git a/Assets/Scripts/Dev/ReviveOnClick.cs b/Assets/Scripts/Dev/ReviveOnClick.cs index 04c94a97..d12f1184 100644 --- a/Assets/Scripts/Dev/ReviveOnClick.cs +++ b/Assets/Scripts/Dev/ReviveOnClick.cs @@ -13,11 +13,11 @@ public class ReviveOnClick : DButtonListener private bool _isClaimClickMissed; - private void Update() - { - if (!_isButton && DInput.IsMouseReleased) - OnClick(); - } + //private void Update() + //{ + // if (!_isButton && DInput.IsMouseReleased) + // OnClick(); + //} protected override void OnClick() { diff --git a/Assets/Source/Scripts/GameProgress.cs b/Assets/Source/Scripts/GameProgress.cs index cfbf3425..d75f64fa 100644 --- a/Assets/Source/Scripts/GameProgress.cs +++ b/Assets/Source/Scripts/GameProgress.cs @@ -1,6 +1,7 @@ using D2D; using D2D.Core; using D2D.Utilities; +using ES3Internal; using Sirenix.OdinInspector; using System; using System.Collections; @@ -28,10 +29,14 @@ public class GameProgress : GameStateMachineUser public Action OnLevelUp; private float levelTime; + [SerializeField] private float timeForLevelUp; + [SerializeField] private float levelUpTimer; + [SerializeField] private bool isStarted = false; + [SerializeField] private bool isFinished = false; public float GetValueForFinish() => totalXP / needToFinish; @@ -137,6 +142,7 @@ public class GameProgress : GameStateMachineUser [Button] public void LevelUp() { + Debug.Log("LevelUp Called"); XPforLevelUp = 0; level++;