diff --git a/Assets/Prefabs/UI/GameUI.prefab b/Assets/Prefabs/UI/GameUI.prefab index 8bc10aa..cbaaeef 100644 --- a/Assets/Prefabs/UI/GameUI.prefab +++ b/Assets/Prefabs/UI/GameUI.prefab @@ -934,6 +934,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: tooltip: {fileID: 7959461870474528235} + ExtraExitCollider: {fileID: 3164206115851743815} ButtonIndex: -1 --- !u!1 &1444386719009988973 GameObject: @@ -1667,6 +1668,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: tooltip: {fileID: 8584771696634545955} + ExtraExitCollider: {fileID: 3164206115851743815} ButtonIndex: -1 --- !u!1 &3452371300238378862 GameObject: @@ -3072,6 +3074,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: tooltip: {fileID: 2899067781696711495} + ExtraExitCollider: {fileID: 3164206115851743815} ButtonIndex: -1 --- !u!1 &5621856367784821633 GameObject: @@ -3950,6 +3953,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: tooltip: {fileID: 4502190811754076786} + ExtraExitCollider: {fileID: 3164206115851743815} ButtonIndex: -1 --- !u!1 &8438906130455969465 GameObject: @@ -4546,6 +4550,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: tooltip: {fileID: 1475988817490299594} + ExtraExitCollider: {fileID: 3164206115851743815} ButtonIndex: -1 --- !u!1001 &1148800059794808287 PrefabInstance: diff --git a/Assets/Scripts/Manager/EnemySpawnManager.cs b/Assets/Scripts/Manager/EnemySpawnManager.cs index 9354542..6bc0366 100644 --- a/Assets/Scripts/Manager/EnemySpawnManager.cs +++ b/Assets/Scripts/Manager/EnemySpawnManager.cs @@ -36,7 +36,6 @@ public class EnemySpawnManager : MonoBehaviour public void OnPlayButtonClicked() { HasStarted = true; - time = waveQueue.Peek().spawnTime; PopWave(); } @@ -63,6 +62,8 @@ public class EnemySpawnManager : MonoBehaviour void PopWave() { + time = 0; + Wave spawnWave = waveQueue.Dequeue(); for (int i = 0; i < spawnWave.groups.Length; i++) { diff --git a/Assets/Scripts/UI/UITooltips.cs b/Assets/Scripts/UI/UITooltips.cs index b7b3318..f589f19 100644 --- a/Assets/Scripts/UI/UITooltips.cs +++ b/Assets/Scripts/UI/UITooltips.cs @@ -10,6 +10,7 @@ public class UITooltips : MonoBehaviour // Not optimal but gamejam momento [SerializeField] private GameObject tooltip; + [SerializeField] private EventTrigger ExtraExitCollider; private EventTrigger uiEvents; public int ButtonIndex = -1; @@ -29,6 +30,12 @@ public class UITooltips : MonoBehaviour pointerEnter.callback.AddListener((data) => { OnEnter((PointerEventData)data); }); uiEvents.triggers.Add(pointerEnter); + // Subscribe to PointerEnter event + EventTrigger.Entry ExtraExitEnter = new EventTrigger.Entry(); + ExtraExitEnter.eventID = EventTriggerType.PointerEnter; + ExtraExitEnter.callback.AddListener((data) => { OnExit((PointerEventData)data); }); + ExtraExitCollider.triggers.Add(ExtraExitEnter); + // Subscribe to PointerExit event EventTrigger.Entry pointerExit = new EventTrigger.Entry(); pointerExit.eventID = EventTriggerType.PointerExit;