Added Player Turn UI Update
This commit is contained in:
parent
1113352c7c
commit
2dd685a90a
@ -31,6 +31,7 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
[SerializeField] private PlayerBaseHandler playerBaseHandler;
|
||||
|
||||
private PlayerType currentPlayerTypeTurn;
|
||||
public PlayerType CurrentPlayerTypeTurn => currentPlayerTypeTurn;
|
||||
private int currentPlayerTurnIndex = 0;
|
||||
|
||||
private List<PlayerType> allPlayerTypes = new List<PlayerType>();
|
||||
@ -43,6 +44,7 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
private Dictionary<PlayerType, Dictionary<int, BotMove>> botRuntimeMovementData = new Dictionary<PlayerType, Dictionary<int, BotMove>>();
|
||||
|
||||
private TilesManager tilesManager;
|
||||
private UIManager uIManager;
|
||||
private GameManager gameManager;
|
||||
|
||||
private int diceRolledValue;
|
||||
@ -75,6 +77,7 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
public void InitializeData()
|
||||
{
|
||||
tilesManager = InterfaceManager.Instance.GetInterfaceInstance<TilesManager>();
|
||||
uIManager = InterfaceManager.Instance.GetInterfaceInstance<UIManager>();
|
||||
gameManager = InterfaceManager.Instance.GetInterfaceInstance<GameManager>();
|
||||
}
|
||||
|
||||
@ -726,6 +729,8 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
currentPlayerTypeTurn = allPlayerTypes[currentPlayerTurnIndex];
|
||||
}
|
||||
|
||||
uIManager.UpdatePlayerTurnText(currentPlayerTypeTurn);
|
||||
|
||||
diceSixRollCounter = 0;
|
||||
diceText.text = $"{0}";
|
||||
|
||||
|
||||
@ -37,6 +37,11 @@ public class UIManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
screenManager.ShowScreen(ScreenType.InGameHUDScreen);
|
||||
}
|
||||
|
||||
public void UpdatePlayerTurnText(PlayerType type)
|
||||
{
|
||||
screenManager.GetScreen<GameHUDS>(ScreenType.InGameHUDScreen).UpdatePlayerTurnText(type);
|
||||
}
|
||||
|
||||
public void OnGameOver()
|
||||
{
|
||||
popupManager.GetPopup<GameOverPopup>(PopupType.GameOverPopup).InitData(gameplayManager.PlayerDatas);
|
||||
|
||||
@ -43,4 +43,27 @@ public class GameHUDS : ScreenBase
|
||||
uiManager = uiManager == null ? InterfaceManager.Instance?.GetInterfaceInstance<UIManager>() : uiManager;
|
||||
uiManager.OnDiceViewInteracted();
|
||||
}
|
||||
|
||||
public void UpdatePlayerTurnText(PlayerType playerType)
|
||||
{
|
||||
Debug.Log($"GameHUDS: UpdatePlayerTurnText: {playerType}");
|
||||
switch (playerType)
|
||||
{
|
||||
case PlayerType.Player1:
|
||||
playerTurnText.text = "Turn : Red";
|
||||
break;
|
||||
case PlayerType.Player2:
|
||||
playerTurnText.text = "Turn : Blue";
|
||||
break;
|
||||
case PlayerType.Player3:
|
||||
playerTurnText.text = "Turn : Grey";
|
||||
break;
|
||||
case PlayerType.Player4:
|
||||
playerTurnText.text = "Turn : Green";
|
||||
break;
|
||||
default:
|
||||
playerTurnText.text = "Turn";
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user