diff --git a/Assets/External-Assets/packages/Project/Scripts/Gameplay/Snake and Ladder/DiceView.cs b/Assets/External-Assets/packages/Project/Scripts/Gameplay/Snake and Ladder/DiceView.cs index 5c62e5b..7f3c349 100644 --- a/Assets/External-Assets/packages/Project/Scripts/Gameplay/Snake and Ladder/DiceView.cs +++ b/Assets/External-Assets/packages/Project/Scripts/Gameplay/Snake and Ladder/DiceView.cs @@ -1,6 +1,7 @@ using System; using System.Collections; using UnityEngine; +using UnityEngine.UI; public class DiceView : MonoBehaviour, IBase { @@ -10,6 +11,7 @@ public class DiceView : MonoBehaviour, IBase [SerializeField] private DiceSide[] diceSides; [SerializeField] private float sideValueTime = 1.2f; [SerializeField] private Vector3 startPos = new Vector3(0, 20, 0); + [SerializeField] private Button diceButton; [Header("Physics Randomness")] [SerializeField] private float baseSpinForce = 900f; @@ -102,6 +104,12 @@ public class DiceView : MonoBehaviour, IBase rolling = false; } + public void SetDiceButtonInteraction(bool status) + { + diceButton.interactable = status; + + } + public void ResetOnSessionEnd() { ResetDice(); diff --git a/Assets/Scripts/Gameplay/GameplayManager.cs b/Assets/Scripts/Gameplay/GameplayManager.cs index 3351c42..52d613b 100644 --- a/Assets/Scripts/Gameplay/GameplayManager.cs +++ b/Assets/Scripts/Gameplay/GameplayManager.cs @@ -240,6 +240,7 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader playerBaseHandler.ShowSelectedPlayerBase(currentPlayerTypeTurn, false); currentPlayerTypeTurn = playerType; playerBaseHandler.ShowSelectedPlayerBase(currentPlayerTypeTurn, true); + diceRollHandler.DiceView.SetDiceButtonInteraction(true); UpdateTurnTimer(); } @@ -573,6 +574,7 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader public void OnDiceRolled(int rolledVal) { SetCanRollDiceForUser(false); + diceRollHandler.DiceView.SetDiceButtonInteraction(false); // add core dice logic here Debug.Log($"Tile Index :: LUDO :: rolledVal: {rolledVal} :: {currentPlayerTypeTurn}");