From 9577ee1777b72e9259c264952129335f0051c7eb Mon Sep 17 00:00:00 2001 From: thedoctor2001 <52832161+thedoctor2001@users.noreply.github.com> Date: Wed, 13 Nov 2024 17:39:36 +0700 Subject: [PATCH] Fix the UI - Fix the timer UI - Remove unused data --- Gama/models/version 2/Flooding VR2.gaml | 2 -- .../Scripts/Gama Provider/Simulation/SimulationManager.cs | 6 ++++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Gama/models/version 2/Flooding VR2.gaml b/Gama/models/version 2/Flooding VR2.gaml index 053b1c82..86881085 100644 --- a/Gama/models/version 2/Flooding VR2.gaml +++ b/Gama/models/version 2/Flooding VR2.gaml @@ -320,8 +320,6 @@ species unity_linker parent: abstract_unity_linker { do send_message players: unity_player as list mes: ["score":: int(100*evacuated/nb_of_people)]; } action add_to_send_world(map map_to_send) { - map_to_send["evacuated"] <- int(evacuated); - map_to_send["score"] <- int(100*evacuated/nb_of_people); map_to_send["remaining_time"] <- int((current_timeout - gama.machine_time)/1000); map_to_send["state"] <- world.state; //map_to_send["winning"] <- winning; diff --git a/URP Quang Binh/Assets/Scripts/Gama Provider/Simulation/SimulationManager.cs b/URP Quang Binh/Assets/Scripts/Gama Provider/Simulation/SimulationManager.cs index 581586c0..89526ec3 100644 --- a/URP Quang Binh/Assets/Scripts/Gama Provider/Simulation/SimulationManager.cs +++ b/URP Quang Binh/Assets/Scripts/Gama Provider/Simulation/SimulationManager.cs @@ -311,14 +311,16 @@ void UpdateGame() } - if (infoWorld.remaining_time > LastTime) + if (infoWorld.state != "s_init" && infoWorld.remaining_time > LastTime) { timer.gameObject.SetActive(true); - //InitDikingTimer = true; Debug.Log("Remaining time: " + infoWorld.remaining_time); timer.StartEnergizedEffect(infoWorld.remaining_time); } + if (infoWorld.state == "s_init" || UIController.Instance.UI_EndingPhase_eng.activeSelf || UIController.Instance.UI_EndingPhase_viet.activeSelf) + timer.gameObject.SetActive(false); + LastTime = infoWorld.remaining_time; } }