From d35f90efaa9c88db3039ad4fc841571ed77efa9d Mon Sep 17 00:00:00 2001 From: Ali Sharoz Date: Tue, 26 Nov 2024 18:14:35 +0500 Subject: [PATCH] Revive Stucking Bug Fixed --- .../3rd/D2D_Scripts/Gameplay/Health/Health.cs | 3 +- .../UI/GameFinishWindowsSwitcher.cs | 1 + .../D2D_Scripts/UI/SetActivityOnGameState.cs | 30 ++++++++++++++++++- Assets/Scripts/Dev/GameManager.cs | 18 +++++++---- ProjectSettings/ProjectSettings.asset | 14 ++++----- 5 files changed, 52 insertions(+), 14 deletions(-) diff --git a/Assets/3rd/D2D_Scripts/Gameplay/Health/Health.cs b/Assets/3rd/D2D_Scripts/Gameplay/Health/Health.cs index 5a4ab878..744deab6 100644 --- a/Assets/3rd/D2D_Scripts/Gameplay/Health/Health.cs +++ b/Assets/3rd/D2D_Scripts/Gameplay/Health/Health.cs @@ -142,6 +142,7 @@ namespace D2D.Gameplay { if (_isPlayer) { + Debug.Log("RewardType: " + rewardedTypes.ToString()); if (rewardedTypes != RewardedTypes.Revive) return; StopCoroutine(deathCoroutine); CurrentPoints = MaxPoints; @@ -157,7 +158,7 @@ namespace D2D.Gameplay IEnumerator DeathCoroutine() { yield return new WaitForSeconds(6f); - GameManager.Instance.OnRevival(); + //GameManager.Instance.OnRevival(); InitiateDeathSequence(); } diff --git a/Assets/3rd/D2D_Scripts/UI/GameFinishWindowsSwitcher.cs b/Assets/3rd/D2D_Scripts/UI/GameFinishWindowsSwitcher.cs index fe63eb12..b16d36be 100644 --- a/Assets/3rd/D2D_Scripts/UI/GameFinishWindowsSwitcher.cs +++ b/Assets/3rd/D2D_Scripts/UI/GameFinishWindowsSwitcher.cs @@ -28,6 +28,7 @@ namespace D2D.UI } private void ShowLoseWindowAfterDelay() { + float delay = UISettings.Instance.loseWindowOpenDelay; _loseWindow.On(after: delay); } diff --git a/Assets/3rd/D2D_Scripts/UI/SetActivityOnGameState.cs b/Assets/3rd/D2D_Scripts/UI/SetActivityOnGameState.cs index 8a96f908..cdf90dcd 100644 --- a/Assets/3rd/D2D_Scripts/UI/SetActivityOnGameState.cs +++ b/Assets/3rd/D2D_Scripts/UI/SetActivityOnGameState.cs @@ -19,7 +19,7 @@ namespace D2D protected override void OnGameFinish() => Show(_onGameFinish); - protected override void OnGameLose() => Show(_onLose); + protected override void OnGameLose() => Show(_onLose,_onReviveOption); protected override void OnGameWin() => Show(_onWin); protected override void OnRevivalState() => Show(_onReviveOption); @@ -48,5 +48,33 @@ namespace D2D o.Off(delay); } } + private void Show(GameObject[] parent, GameObject[] disableParent) + { + + if (parent.IsNullOrEmpty()) + return; + + foreach (GameObject o in disableParent) + { + o.gameObject.SetActive(false); + } + foreach (GameObject o in parent) + { + float delay = _delay; + + if (o == null) + continue; + + var window = o.GetComponent(); + + if (window != null) + delay = window.OpenDelay; + + if (_toggleToActive) + o.On(delay); + else + o.Off(delay); + } + } } } \ No newline at end of file diff --git a/Assets/Scripts/Dev/GameManager.cs b/Assets/Scripts/Dev/GameManager.cs index 599b4b49..a1674b6c 100644 --- a/Assets/Scripts/Dev/GameManager.cs +++ b/Assets/Scripts/Dev/GameManager.cs @@ -9,12 +9,12 @@ public class GameManager : MonoBehaviour private void Awake() { - if (Instance is null) + //if (Instance is null) Instance = this; - else - { - DestroyImmediate(this); - } + //else + //{ + // DestroyImmediate(this); + //} } @@ -24,11 +24,19 @@ public class GameManager : MonoBehaviour public void OnRevival() { + Debug.Log("OnRevival"); if (ReviveCanvas != null) { + + Debug.Log("OnRevival2"); ReviveCanvas.SetActive(false); reviveOnClick.Was = false; } + else + { + Debug.Log("Revival Canvas == null"); + + } } } diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset index 910bf6d6..7e9bf42d 100644 --- a/ProjectSettings/ProjectSettings.asset +++ b/ProjectSettings/ProjectSettings.asset @@ -140,7 +140,7 @@ PlayerSettings: loadStoreDebugModeEnabled: 0 visionOSBundleVersion: 1.0 tvOSBundleVersion: 1.0 - bundleVersion: 1.1 + bundleVersion: 0.1 preloadedAssets: [] metroInputSource: 0 wsaTransparentSwapchain: 0 @@ -171,7 +171,7 @@ PlayerSettings: iPhone: 0 tvOS: 0 overrideDefaultApplicationIdentifier: 1 - AndroidBundleVersionCode: 3 + AndroidBundleVersionCode: 7 AndroidMinSdkVersion: 22 AndroidTargetSdkVersion: 35 AndroidPreferredInstallLocation: 1 @@ -290,7 +290,7 @@ PlayerSettings: - m_BuildTarget: m_Icons: - serializedVersion: 2 - m_Icon: {fileID: 2800000, guid: ea801209ccd4d9149be6a72b38b50f52, type: 3} + m_Icon: {fileID: 2800000, guid: 09b5cb90a026d2c49bd8a9699138f1e1, type: 3} m_Width: 128 m_Height: 128 m_Kind: 0 @@ -936,7 +936,7 @@ PlayerSettings: XboxOneOverrideIdentityPublisher: vrEditorSettings: {} cloudServicesEnabled: - Purchasing: 1 + Purchasing: 0 UNet: 1 luminIcon: m_Name: @@ -957,11 +957,11 @@ PlayerSettings: apiCompatibilityLevel: 6 activeInputHandler: 0 windowsGamepadBackendHint: 0 - cloudProjectId: f692c634-56c3-45e3-a92e-6c84712edd18 + cloudProjectId: framebufferDepthMemorylessMode: 0 qualitySettingsNames: [] - projectName: Heroes Of Labyrinth - organizationId: rizzestudios + projectName: + organizationId: cloudEnabled: 0 legacyClampBlendShapeWeights: 0 hmiLoadingImage: {fileID: 0}