From 2127bf37b2da92ac33601f8385ece1cd8569dd3c Mon Sep 17 00:00:00 2001 From: Michal Pikulski Date: Fri, 7 Nov 2025 17:26:25 +0100 Subject: [PATCH] Add boosters to minigame again --- .../Boosters/MiniGameBoosterGiver.prefab | 60 +++++-- .../Scenes/MiniGames/DivingForPictures.unity | 155 +++++++++++++++--- .../Scripts/Cinematics/CinematicsManager.cs | 5 +- .../DivingForPictures/DivingGameManager.cs | 16 +- 4 files changed, 193 insertions(+), 43 deletions(-) diff --git a/Assets/Prefabs/UI/CardsSystem/Boosters/MiniGameBoosterGiver.prefab b/Assets/Prefabs/UI/CardsSystem/Boosters/MiniGameBoosterGiver.prefab index d2bc2e60..2342a852 100644 --- a/Assets/Prefabs/UI/CardsSystem/Boosters/MiniGameBoosterGiver.prefab +++ b/Assets/Prefabs/UI/CardsSystem/Boosters/MiniGameBoosterGiver.prefab @@ -61,6 +61,43 @@ MonoBehaviour: targetBottomLeftOffset: {x: 100, y: 100} disappearDuration: 0.8 disappearScale: 0.2 +--- !u!1 &2923535299741790846 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5109945643968698326} + m_Layer: 0 + m_Name: BoosterContainer + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &5109945643968698326 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2923535299741790846} + 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: 4006246129058447062} + - {fileID: 3680365639323743419} + m_Father: {fileID: 2499229096808986326} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 1} + m_AnchorMax: {x: 0.5, y: 1} + m_AnchoredPosition: {x: 0, y: -300} + m_SizeDelta: {x: 750, y: 760} + m_Pivot: {x: 0.5, y: 1} --- !u!1 &4323719263405703996 GameObject: m_ObjectHideFlags: 0 @@ -211,13 +248,13 @@ RectTransform: m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] - m_Father: {fileID: 2499229096808986326} + m_Father: {fileID: 5109945643968698326} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0.5, y: 1} - m_AnchorMax: {x: 0.5, y: 1} - m_AnchoredPosition: {x: 0, y: -250} + 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: 800, y: 800} - m_Pivot: {x: 0.5, y: 1} + m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &5796229481733252802 CanvasRenderer: m_ObjectHideFlags: 0 @@ -285,9 +322,8 @@ RectTransform: m_ConstrainProportionsScale: 0 m_Children: - {fileID: 1338508664922812659} - - {fileID: 4006246129058447062} - - {fileID: 3680365639323743419} - {fileID: 6841858894429745291} + - {fileID: 5109945643968698326} m_Father: {fileID: 1966378914653314124} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} @@ -400,13 +436,13 @@ RectTransform: m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] - m_Father: {fileID: 2499229096808986326} + m_Father: {fileID: 5109945643968698326} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0.5, y: 1} - m_AnchorMax: {x: 0.5, y: 1} - m_AnchoredPosition: {x: 0, y: -250} + 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: 411, y: 729} - m_Pivot: {x: 0.5, y: 1} + m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &8906420622179058179 CanvasRenderer: m_ObjectHideFlags: 0 diff --git a/Assets/Scenes/MiniGames/DivingForPictures.unity b/Assets/Scenes/MiniGames/DivingForPictures.unity index 3f244591..442e01fa 100644 --- a/Assets/Scenes/MiniGames/DivingForPictures.unity +++ b/Assets/Scenes/MiniGames/DivingForPictures.unity @@ -305,6 +305,7 @@ RectTransform: m_ConstrainProportionsScale: 0 m_Children: - {fileID: 1224833349} + - {fileID: 471921060} m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} @@ -418,16 +419,16 @@ LineRenderer: m_SortingOrder: 0 m_Positions: - {x: -0.15602553, y: 4.074945, z: 0} - - {x: -0.1566351, y: 3.9736383, z: 0} - - {x: -0.1572447, y: 3.8729858, z: 0} + - {x: -0.1566351, y: 3.973638, z: 0} + - {x: -0.1572447, y: 3.8729856, z: 0} - {x: -0.15785426, y: 3.7729874, z: 0} - - {x: -0.15846384, y: 3.673644, z: 0} - - {x: -0.15907341, y: 3.5749543, z: 0} - - {x: -0.15968299, y: 3.4769197, z: 0} + - {x: -0.15846384, y: 3.6736436, z: 0} + - {x: -0.15907341, y: 3.574954, z: 0} + - {x: -0.15968299, y: 3.4769192, z: 0} - {x: -0.16029257, y: 3.3795385, z: 0} - {x: -0.16090216, y: 3.2828126, z: 0} - - {x: -0.16151173, y: 3.1867406, z: 0} - - {x: -0.16212131, y: 3.0913231, z: 0} + - {x: -0.16151173, y: 3.1867409, z: 0} + - {x: -0.16212131, y: 3.0913236, z: 0} m_Parameters: serializedVersion: 3 widthMultiplier: 1 @@ -1098,6 +1099,112 @@ Animator: m_AllowConstantClipSamplingOptimization: 1 m_KeepAnimatorStateOnDisable: 0 m_WriteDefaultValuesOnDisable: 0 +--- !u!1001 &471921059 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 116234201} + m_Modifications: + - target: {fileID: 1439929750438628637, guid: a855ba60e86bf1e449197f1f5f9b9b73, type: 3} + propertyPath: m_Name + value: MiniGameBoosterGiver + objectReference: {fileID: 0} + - target: {fileID: 1966378914653314124, guid: a855ba60e86bf1e449197f1f5f9b9b73, type: 3} + propertyPath: m_Pivot.x + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 1966378914653314124, guid: a855ba60e86bf1e449197f1f5f9b9b73, type: 3} + propertyPath: m_Pivot.y + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 1966378914653314124, guid: a855ba60e86bf1e449197f1f5f9b9b73, type: 3} + propertyPath: m_AnchorMax.x + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 1966378914653314124, guid: a855ba60e86bf1e449197f1f5f9b9b73, type: 3} + propertyPath: m_AnchorMax.y + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 1966378914653314124, guid: a855ba60e86bf1e449197f1f5f9b9b73, type: 3} + propertyPath: m_AnchorMin.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1966378914653314124, guid: a855ba60e86bf1e449197f1f5f9b9b73, type: 3} + propertyPath: m_AnchorMin.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1966378914653314124, guid: a855ba60e86bf1e449197f1f5f9b9b73, type: 3} + propertyPath: m_SizeDelta.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1966378914653314124, guid: a855ba60e86bf1e449197f1f5f9b9b73, type: 3} + propertyPath: m_SizeDelta.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1966378914653314124, guid: a855ba60e86bf1e449197f1f5f9b9b73, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1966378914653314124, guid: a855ba60e86bf1e449197f1f5f9b9b73, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1966378914653314124, guid: a855ba60e86bf1e449197f1f5f9b9b73, type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1966378914653314124, guid: a855ba60e86bf1e449197f1f5f9b9b73, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 1966378914653314124, guid: a855ba60e86bf1e449197f1f5f9b9b73, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1966378914653314124, guid: a855ba60e86bf1e449197f1f5f9b9b73, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1966378914653314124, guid: a855ba60e86bf1e449197f1f5f9b9b73, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1966378914653314124, guid: a855ba60e86bf1e449197f1f5f9b9b73, type: 3} + propertyPath: m_AnchoredPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1966378914653314124, guid: a855ba60e86bf1e449197f1f5f9b9b73, type: 3} + propertyPath: m_AnchoredPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1966378914653314124, guid: a855ba60e86bf1e449197f1f5f9b9b73, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1966378914653314124, guid: a855ba60e86bf1e449197f1f5f9b9b73, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1966378914653314124, guid: a855ba60e86bf1e449197f1f5f9b9b73, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8617171489468030463, guid: a855ba60e86bf1e449197f1f5f9b9b73, type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: a855ba60e86bf1e449197f1f5f9b9b73, type: 3} +--- !u!224 &471921060 stripped +RectTransform: + m_CorrespondingSourceObject: {fileID: 1966378914653314124, guid: a855ba60e86bf1e449197f1f5f9b9b73, type: 3} + m_PrefabInstance: {fileID: 471921059} + m_PrefabAsset: {fileID: 0} --- !u!1 &730962732 GameObject: m_ObjectHideFlags: 0 @@ -1783,14 +1890,14 @@ LineRenderer: - {x: -0.15602553, y: 4.0749445, z: 0} - {x: -0.11662118, y: 3.879622, z: 0} - {x: -0.07721684, y: 3.7057445, z: 0} - - {x: -0.03781248, y: 3.5533104, z: 0} - - {x: 0.0015918687, y: 3.4223213, z: 0} - - {x: 0.040996216, y: 3.312776, z: 0} - - {x: 0.08040057, y: 3.2246757, z: 0} - - {x: 0.11980491, y: 3.1580195, z: 0} - - {x: 0.15920927, y: 3.1128078, z: 0} - - {x: 0.1986136, y: 3.0890403, z: 0} - - {x: 0.23801796, y: 3.0867171, z: 0} + - {x: -0.03781248, y: 3.5533106, z: 0} + - {x: 0.0015918687, y: 3.4223216, z: 0} + - {x: 0.040996216, y: 3.3127766, z: 0} + - {x: 0.08040057, y: 3.2246761, z: 0} + - {x: 0.11980491, y: 3.15802, z: 0} + - {x: 0.15920927, y: 3.1128082, z: 0} + - {x: 0.1986136, y: 3.0890405, z: 0} + - {x: 0.23801796, y: 3.0867176, z: 0} m_Parameters: serializedVersion: 3 widthMultiplier: 1 @@ -2503,14 +2610,14 @@ LineRenderer: - {x: -0.15602553, y: 4.0749445, z: 0} - {x: -0.18956745, y: 3.8764973, z: 0} - {x: -0.22310936, y: 3.7000232, z: 0} - - {x: -0.25665125, y: 3.54552, z: 0} - - {x: -0.29019317, y: 3.4129906, z: 0} - - {x: -0.32373506, y: 3.302433, z: 0} - - {x: -0.35727698, y: 3.213848, z: 0} - - {x: -0.39081886, y: 3.1472354, z: 0} - - {x: -0.4243608, y: 3.1025953, z: 0} - - {x: -0.45790267, y: 3.0799277, z: 0} - - {x: -0.4914446, y: 3.0792325, z: 0} + - {x: -0.25665125, y: 3.5455203, z: 0} + - {x: -0.29019317, y: 3.412991, z: 0} + - {x: -0.32373506, y: 3.3024335, z: 0} + - {x: -0.35727698, y: 3.2138484, z: 0} + - {x: -0.39081886, y: 3.1472359, z: 0} + - {x: -0.4243608, y: 3.1025958, z: 0} + - {x: -0.45790267, y: 3.0799282, z: 0} + - {x: -0.4914446, y: 3.079233, z: 0} m_Parameters: serializedVersion: 3 widthMultiplier: 1 @@ -3358,7 +3465,7 @@ Transform: m_GameObject: {fileID: 2106431001} serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: -0.165, y: 2.697517, z: 0} + m_LocalPosition: {x: -0.165, y: 2.6975174, z: 0} m_LocalScale: {x: 0.57574, y: 0.57574, z: 0.57574} m_ConstrainProportionsScale: 0 m_Children: diff --git a/Assets/Scripts/Cinematics/CinematicsManager.cs b/Assets/Scripts/Cinematics/CinematicsManager.cs index a697b3a5..064c0928 100644 --- a/Assets/Scripts/Cinematics/CinematicsManager.cs +++ b/Assets/Scripts/Cinematics/CinematicsManager.cs @@ -206,7 +206,10 @@ namespace Cinematics } public void ShowGameOverScreen() - { + { + // Diagnostic: log time and call stack to track when/why game over is triggered + Logging.Debug($"[CinematicsManager] ShowGameOverScreen called at time={Time.time:F2}"); + if (divingGameOverScreen != null && UIPageController.Instance != null) { UIPageController.Instance.PushPage(divingGameOverScreen); diff --git a/Assets/Scripts/Minigames/DivingForPictures/DivingGameManager.cs b/Assets/Scripts/Minigames/DivingForPictures/DivingGameManager.cs index 6caa6212..fe119480 100644 --- a/Assets/Scripts/Minigames/DivingForPictures/DivingGameManager.cs +++ b/Assets/Scripts/Minigames/DivingForPictures/DivingGameManager.cs @@ -668,16 +668,20 @@ namespace Minigames.DivingForPictures if (giver != null) { UIPageController.Instance.ShowAllUI(); - giver.GiveBooster(() => { completed = true; }); + Logging.Debug("[DivingGameManager] Starting booster giver sequence"); + giver.GiveBooster(() => + { + completed = true; + Logging.Debug("[DivingGameManager] Booster giver completed callback received"); + }); - // 2) Wait for it to finish (with a safety timeout in case it's not wired) - float timeout = 10f; // fallback to avoid blocking forever - float elapsed = 0f; - while (!completed && elapsed < timeout) + // 2) Wait for it to finish (NO timeout - wait indefinitely for user interaction) + while (!completed) { - elapsed += Time.unscaledDeltaTime; yield return null; } + + Logging.Debug("[DivingGameManager] Booster giver sequence finished, proceeding to game over"); } else {