Restrict Dice roll interaction
This commit is contained in:
parent
fc4aeda01c
commit
3f68064a5f
@ -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();
|
||||
|
||||
@ -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}");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user