Major Refactoring + fixes for new feedback logic + tiny visual fixes with dice logic.
This commit is contained in:
parent
b41e2990fc
commit
8be8ffae15
@ -8492,10 +8492,12 @@ MonoBehaviour:
|
||||
isDebugPlayerTest: 0
|
||||
diceRollHandler: {fileID: 1013177415}
|
||||
diceValue: 0
|
||||
diceRollDelay: 0.7
|
||||
diceRollDelayForBot: 0.5
|
||||
diceRollDelayForUser: 0.5
|
||||
maxDiceSixRollCounter: 2
|
||||
totalStepsForCharacter: 57
|
||||
currentPlayerTurnMaxTime: 4
|
||||
currentPlayerTurnMaxTime: 2
|
||||
currentPlayerSelectionMaxTime: 2
|
||||
diceText: {fileID: 953941044}
|
||||
pointerDebug: {fileID: 102349503}
|
||||
pointerMeshRend: {fileID: 102349501}
|
||||
|
||||
@ -132,8 +132,6 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
|
||||
playerBaseHandler.InitPlayerTypes(allPlayerTypes);
|
||||
InitCurrentGamePlayerInfo();
|
||||
|
||||
// SetCanRollDiceForUser(true);
|
||||
}
|
||||
|
||||
public void InitPlayerTypesForBotMatch(PlayerData selectedPlayerData, int botCount)
|
||||
@ -263,15 +261,16 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
if (gameModeHandler.CurrentGameModeType == GameModeType.Bot)
|
||||
{
|
||||
bool isBotTurn = botTypesInGame.Contains(currentPlayerTypeTurn);
|
||||
SetCanRollDiceForUser(!isBotTurn);
|
||||
// SetCanRollDiceForUser(!isBotTurn); // TODO :: Need to change
|
||||
if (isBotTurn)
|
||||
{
|
||||
currentPlayerTurnTimer.KillTimer();
|
||||
uIManager.UpdatePlayerTurnText(currentPlayerTypeTurn);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
SetCanRollDiceForUser(true);
|
||||
// else
|
||||
// SetCanRollDiceForUser(true); // TODO :: Need to change
|
||||
|
||||
uIManager.UpdatePlayerTurnText(currentPlayerTypeTurn, currentPlayerMaxTime);
|
||||
|
||||
@ -309,6 +308,7 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
public void InitCurrentGamePlayerInfo()
|
||||
{
|
||||
UpdateCurrentPlayerTurn(allPlayerTypes[currentPlayerTurnIndex]);
|
||||
SetCanRollDiceForUser(IsUsersTurn());
|
||||
UpdateDiceView();
|
||||
Debug.Log($"currentPlayerTypeTurn: {currentPlayerTypeTurn}");
|
||||
|
||||
@ -361,14 +361,12 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
playerPawn.Value.SetPlayerSelectionState(state);
|
||||
}
|
||||
}
|
||||
|
||||
public void OnDiceInteracted()
|
||||
{
|
||||
ResetCurrentPlayerTurnTimer();
|
||||
RollDiceForUser();
|
||||
}
|
||||
|
||||
@ -538,7 +536,9 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
}
|
||||
|
||||
if (CanRollDiceAgain)
|
||||
{
|
||||
RollDiceForBot();
|
||||
}
|
||||
else
|
||||
SwitchPlayer();
|
||||
}
|
||||
@ -614,6 +614,7 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
#endif
|
||||
}
|
||||
|
||||
FilterAvailablePlayersToMove();
|
||||
if (rolledVal == Ludo_3D_Constants.Max_Dice_Rolls)
|
||||
{
|
||||
canSwitchPlayer = false;
|
||||
@ -637,7 +638,11 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
else
|
||||
{
|
||||
if (playerGameDatasDict[currentPlayerTypeTurn].totalPawnsInHome < 1 && CanMoveSoloPlayer())
|
||||
{
|
||||
SetPlayerSelectionStates(false);
|
||||
OnPawnSelected(availPlayersToMove[0]);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -649,6 +654,8 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
if (AreAllPawnsInFinishingPath())
|
||||
{
|
||||
SetCanRollDiceForUser(IsUsersTurn());
|
||||
UpdateResponseTimerForUser(currentPlayerSelectionMaxTime, () => RollDiceForUser());
|
||||
CheckForMaxDiceRollAttempt();
|
||||
|
||||
return;
|
||||
}
|
||||
@ -658,68 +665,81 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
else
|
||||
{
|
||||
Debug.Log($"before CustomAvailablePlayers: {availPlayersToMove.Count}");
|
||||
List<int> indexesToRemove = new List<int>();
|
||||
|
||||
for (int i = 0; i < availPlayersToMove.Count; i++)
|
||||
{
|
||||
Debug.Log($"## playerPawn.GetPlayerState(): {availPlayersToMove[i].GetPlayerState()}");
|
||||
|
||||
if (availPlayersToMove[i].GetPlayerState() == PlayerState.InFinishingPath)
|
||||
{
|
||||
Debug.Log($"diceRolledValue: {diceRolledValue}, FinishingDataLen: {TilesManager.GetFinishingTileDataLength(currentPlayerTypeTurn)}, playerPawn.CurrentTileIndex: {availPlayersToMove[i].CurrentTileIndex}");
|
||||
if (diceRolledValue <= TilesManager.GetFinishingTileDataLength(currentPlayerTypeTurn) - (availPlayersToMove[i].CurrentTileIndex + 1))
|
||||
{
|
||||
availPlayersToMove[i].SetPlayerSelectionState(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
indexesToRemove.Add(i);
|
||||
availPlayersToMove[i].SetPlayerSelectionState(false);
|
||||
#if UNITY_EDITOR
|
||||
availPlayersToMove[i].ShowPlayerCountCanvas(false);
|
||||
#endif
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
availPlayersToMove[i].SetPlayerSelectionState(true);
|
||||
}
|
||||
|
||||
for (int idx = indexesToRemove.Count - 1; idx >= 0; idx--)
|
||||
availPlayersToMove.RemoveAt(idx);
|
||||
|
||||
// TODO :: Show the selectable characters indicator here
|
||||
Debug.Log($"CustomAvailablePlayers: {availPlayersToMove.Count}");
|
||||
canSwitchPlayer = availPlayersToMove.Count < 1;
|
||||
CanRollDiceAgain = false;
|
||||
}
|
||||
|
||||
if (IsUsersTurn() && availPlayersToMove.Count > 0)
|
||||
diceRollHandler.DiceView.SetDiceButtonInteraction(CanRollDiceAgain);
|
||||
Debug.Log($"CanRollDiceAgain: {CanRollDiceAgain}, canSwitchPlayer: {canSwitchPlayer}");
|
||||
|
||||
if (IsUsersTurn())
|
||||
{
|
||||
Action onComplete = null;
|
||||
if (CanRollDiceAgain && availPlayersToMove.Count < 1 &&
|
||||
playerGameDatasDict[currentPlayerTypeTurn].totalPawnsInHome > 0)
|
||||
{
|
||||
onComplete = () => OnPawnSelected(playerGameDatasDict[currentPlayerTypeTurn].playerPawnsDict.Values
|
||||
.FirstOrDefault(pawn => pawn.GetPlayerState() == PlayerState.InHome));
|
||||
|
||||
UpdateResponseTimerForUser(currentPlayerSelectionMaxTime, () => onComplete?.Invoke());
|
||||
}
|
||||
else if (availPlayersToMove.Count > 0)
|
||||
{
|
||||
if (CanRollDiceAgain && playerGameDatasDict[currentPlayerTypeTurn].totalPawnsInHome > 0)
|
||||
{
|
||||
onComplete = () => OnPawnSelected(playerGameDatasDict[currentPlayerTypeTurn].playerPawnsDict.Values
|
||||
.FirstOrDefault(pawn => pawn.GetPlayerState() == PlayerState.InHome));
|
||||
UpdateResponseTimerForUser(currentPlayerSelectionMaxTime, () => onComplete?.Invoke());
|
||||
return;
|
||||
}
|
||||
|
||||
if (CanMoveSoloPlayer())
|
||||
{
|
||||
SetPlayerSelectionStates(false);
|
||||
OnPawnSelected(availPlayersToMove[0]);
|
||||
return;
|
||||
}
|
||||
|
||||
onComplete = () => OnPawnSelected(availPlayersToMove.OrderByDescending(pawn => pawn.StepsTaken).FirstOrDefault());
|
||||
UpdateResponseTimerForUser(currentPlayerSelectionMaxTime, () => onComplete?.Invoke());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
diceRollHandler.DiceView.SetDiceButtonInteraction(CanRollDiceAgain);
|
||||
private void FilterAvailablePlayersToMove()
|
||||
{
|
||||
List<int> indexesToRemove = new List<int>();
|
||||
|
||||
Action onComplete = null;
|
||||
if (CanRollDiceAgain && availPlayersToMove.Count < 1 && playerGameDatasDict[currentPlayerTypeTurn].totalPawnsInHome > 0)
|
||||
for (int i = 0; i < availPlayersToMove.Count; i++)
|
||||
{
|
||||
onComplete = () => OnPawnSelected(playerGameDatasDict[currentPlayerTypeTurn].playerPawnsDict.Values
|
||||
.FirstOrDefault(pawn => pawn.GetPlayerState() == PlayerState.InHome));
|
||||
}
|
||||
else if (availPlayersToMove.Count > 0)
|
||||
{
|
||||
onComplete = () => availPlayersToMove.OrderByDescending(pawn => pawn.StepsTaken).FirstOrDefault();
|
||||
Debug.Log($"## playerPawn.GetPlayerState(): {availPlayersToMove[i].GetPlayerState()}");
|
||||
|
||||
if (availPlayersToMove[i].GetPlayerState() == PlayerState.InFinishingPath)
|
||||
{
|
||||
Debug.Log($"diceRolledValue: {diceRolledValue}, FinishingDataLen: {TilesManager.GetFinishingTileDataLength(currentPlayerTypeTurn)}, playerPawn.CurrentTileIndex: {availPlayersToMove[i].CurrentTileIndex}");
|
||||
if (diceRolledValue <= TilesManager.GetFinishingTileDataLength(currentPlayerTypeTurn) - (availPlayersToMove[i].CurrentTileIndex + 1))
|
||||
{
|
||||
availPlayersToMove[i].SetPlayerSelectionState(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
indexesToRemove.Add(i);
|
||||
availPlayersToMove[i].SetPlayerSelectionState(false);
|
||||
#if UNITY_EDITOR
|
||||
availPlayersToMove[i].ShowPlayerCountCanvas(false);
|
||||
#endif
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
availPlayersToMove[i].SetPlayerSelectionState(true);
|
||||
}
|
||||
|
||||
UpdateResponseTimerForUser(currentPlayerSelectionMaxTime, () => onComplete?.Invoke());
|
||||
|
||||
Debug.Log($"CanRollDiceAgain: {CanRollDiceAgain}, canSwitchPlayer: {canSwitchPlayer}");
|
||||
for (int idx = indexesToRemove.Count - 1; idx >= 0; idx--)
|
||||
availPlayersToMove.RemoveAt(idx);
|
||||
}
|
||||
|
||||
private bool CanMoveSoloPlayer()
|
||||
@ -768,6 +788,12 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
|
||||
private void UpdatePlayerState(PlayerPawn playerPawn, PlayerState playerState)
|
||||
{
|
||||
if (!playerPawn)
|
||||
{
|
||||
// Debug.LogError($"Player pawn is null");
|
||||
return;
|
||||
}
|
||||
|
||||
Debug.Log($"#### UpdatePlayerState ");
|
||||
playerGameDatasDict[playerPawn.PlayerType].playerPawnsDict[playerPawn.PlayerId] = playerPawn;
|
||||
playerGameDatasDict[playerPawn.PlayerType].playerPawnsDict[playerPawn.PlayerId].SetPlayerState(playerState);
|
||||
@ -784,6 +810,7 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
|
||||
private void RollDiceForUser()
|
||||
{
|
||||
ResetCurrentPlayerTurnTimer();
|
||||
InitActivePlayers();
|
||||
bool canUsePawnsFromHome = CanUsePawnsFromHome();
|
||||
diceRollHandler.HandleDiceViewForUser(
|
||||
@ -793,6 +820,7 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
|
||||
private void RollDiceForBot()
|
||||
{
|
||||
ResetCurrentPlayerTurnTimer();
|
||||
InitActivePlayers();
|
||||
HandleDiceRollForBot();
|
||||
}
|
||||
@ -826,6 +854,7 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
{
|
||||
// TODO :: Hide the selectable characters indicator here
|
||||
SetPlayerSelectionStates(false);
|
||||
if (IsUsersTurn()) currentPlayerTurnTimer.KillTimer();
|
||||
|
||||
PlayerGameData playerGameData = playerGameDatasDict[currentPlayerTypeTurn];
|
||||
Debug.Log($"playerPawn.GetPlayerState(): {selectedPawn.GetPlayerState()}");
|
||||
@ -854,7 +883,10 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
if (selectedPawn.IsBotPlayer)
|
||||
CheckDiceRollForBot();
|
||||
else
|
||||
{
|
||||
SetCanRollDiceForUser(IsUsersTurn());
|
||||
UpdateResponseTimerForUser(currentPlayerMaxTime: currentPlayerTurnMaxTime, () => RollDiceForUser());
|
||||
}
|
||||
|
||||
}, playerGameData.startIndex);
|
||||
|
||||
@ -987,24 +1019,29 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
Debug.Log($"IsUsersTurn: {IsUsersTurn()}");
|
||||
if (IsUsersTurn())
|
||||
{
|
||||
SetCanRollDiceForUser(true);
|
||||
Invoke(nameof(UpdateDiceView), diceRollDelayForUser);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetCanRollDiceForUser(false);
|
||||
currentPlayerTurnTimer.KillTimer();
|
||||
Invoke(nameof(UpdateDiceViewForBot), diceRollDelayForBot);
|
||||
}
|
||||
|
||||
diceSixRollCounter = 0;
|
||||
diceText.text = $"{0}";
|
||||
}
|
||||
else
|
||||
{
|
||||
UpdateResponseTimerForUser(currentPlayerMaxTime: currentPlayerTurnMaxTime, () => RollDiceForUser());
|
||||
|
||||
if (gameModeHandler.CurrentGameModeType == GameModeType.Bot && botTypesInGame.Contains(currentPlayerTypeTurn)) // TODO :: Double check calling of the function
|
||||
{
|
||||
Debug.Log($"Invoking RollDiceForBot");
|
||||
HandleDiceRollWithDelay();
|
||||
}
|
||||
}
|
||||
// else
|
||||
// {
|
||||
// UpdateResponseTimerForUser(currentPlayerMaxTime: currentPlayerTurnMaxTime, () => RollDiceForUser());
|
||||
//
|
||||
// if (gameModeHandler.CurrentGameModeType == GameModeType.Bot && botTypesInGame.Contains(currentPlayerTypeTurn)) // TODO :: Double check calling of the function
|
||||
// {
|
||||
// Debug.Log($"Invoking RollDiceForBot");
|
||||
// HandleDiceRollWithDelay();
|
||||
// }
|
||||
// }
|
||||
|
||||
Debug.Log($"currentPlayerTurnIndex: {currentPlayerTurnIndex}");
|
||||
Debug.Log($"CurrentPlayerTurn: {currentPlayerTypeTurn}");
|
||||
@ -1016,6 +1053,20 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
#endif
|
||||
}
|
||||
|
||||
private void OnCanRollDiceAgain(PlayerPawn playerPawn = null)
|
||||
{
|
||||
if (playerPawn)
|
||||
UpdatePlayerState(playerPawn, TilesManager.RetrieveTileBasedOnIndex(playerPawn.CurrentTileIndex).IsSafeZone ? PlayerState.InSafeZone : PlayerState.Moving);
|
||||
|
||||
UpdateResponseTimerForUser(currentPlayerMaxTime: currentPlayerTurnMaxTime, () => RollDiceForUser());
|
||||
|
||||
if (gameModeHandler.CurrentGameModeType == GameModeType.Bot && botTypesInGame.Contains(currentPlayerTypeTurn)) // TODO :: Double check calling of the function
|
||||
{
|
||||
Debug.Log($"Invoking RollDiceForBot");
|
||||
HandleDiceRollWithDelay();
|
||||
}
|
||||
}
|
||||
|
||||
private void MoveThroughTiles(PlayerPawn playerPawn, int index, int targetIndex)
|
||||
{
|
||||
Tile nextTile = TilesManager.RetrieveTileBasedOnIndex(index);
|
||||
@ -1104,12 +1155,6 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
}
|
||||
|
||||
CanRollDiceAgain = true;
|
||||
if (!playerPawn.IsBotPlayer)
|
||||
{
|
||||
UpdateResponseTimerForUser(currentPlayerMaxTime: currentPlayerTurnMaxTime, () => RollDiceForUser());
|
||||
}
|
||||
|
||||
diceRollHandler.DiceView.SetDiceButtonInteraction(CanRollDiceAgain);
|
||||
}
|
||||
|
||||
nextTile.InitPlayerPawn(playerPawn, currentPlayerTypeTurn);
|
||||
@ -1130,7 +1175,18 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
}
|
||||
}
|
||||
|
||||
SwitchPlayer(playerPawn);
|
||||
if (!CanRollDiceAgain) SwitchPlayer(playerPawn);
|
||||
else
|
||||
{
|
||||
if (IsUsersTurn())
|
||||
{
|
||||
UpdateResponseTimerForUser(currentPlayerMaxTime: currentPlayerTurnMaxTime, () => RollDiceForUser());
|
||||
SetCanRollDiceForUser(IsUsersTurn());
|
||||
}
|
||||
|
||||
OnCanRollDiceAgain(playerPawn);
|
||||
diceRollHandler.DiceView.SetDiceButtonInteraction(true);
|
||||
}
|
||||
}
|
||||
},
|
||||
index);
|
||||
@ -1180,6 +1236,7 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
// ShowUpdatedPlayerCountOnTile(playerPawn);
|
||||
|
||||
UpdatePlayerState(playerPawn, PlayerState.HasFinished);
|
||||
playerPawn.SetPlayerSelectionState(false);
|
||||
|
||||
playerGameDatasDict[currentPlayerTypeTurn].totalPawnsFinished++;
|
||||
playerGameDatasDict[currentPlayerTypeTurn].totalPawnsInFinishingPath--;
|
||||
@ -1221,6 +1278,7 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
CheckDiceRollForBot();
|
||||
else
|
||||
{
|
||||
SetCanRollDiceForUser(true);
|
||||
UpdateResponseTimerForUser(currentPlayerMaxTime: currentPlayerTurnMaxTime, () => RollDiceForUser());
|
||||
}
|
||||
|
||||
@ -1239,12 +1297,14 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
|
||||
if (CanRollDiceAgain)
|
||||
{
|
||||
SetCanRollDiceForUser(IsUsersTurn());
|
||||
OnCanRollDiceAgain();
|
||||
#if UNITY_EDITOR
|
||||
ShowUpdatedPlayerCountOnTile(playerPawn);
|
||||
#endif
|
||||
}
|
||||
|
||||
SwitchPlayer();
|
||||
else
|
||||
SwitchPlayer();
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -1302,17 +1362,20 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
|
||||
public void ResetTileDatasForPlayers()
|
||||
{
|
||||
foreach (PlayerData data in playerDatas)
|
||||
{
|
||||
var pawns = playerGameDatasDict[data.playerType].playerPawnsDict.Values;
|
||||
// causes null ref cast exception while player is moving.
|
||||
// foreach (PlayerData data in playerDatas)
|
||||
// {
|
||||
// var pawns = playerGameDatasDict[data.playerType].playerPawnsDict.Values;
|
||||
//
|
||||
// foreach (var pawn in pawns)
|
||||
// {
|
||||
// if (pawn.GetPlayerState() == PlayerState.InHome) continue;
|
||||
//
|
||||
// TilesManager.ResetTileData(pawn.PlayerType, pawn.CurrentTileIndex, pawn.GetPlayerState());
|
||||
// }
|
||||
// }
|
||||
|
||||
foreach (var pawn in pawns)
|
||||
{
|
||||
if (pawn.GetPlayerState() == PlayerState.InHome) continue;
|
||||
|
||||
TilesManager.ResetTileData(pawn.PlayerType, pawn.CurrentTileIndex, pawn.GetPlayerState());
|
||||
}
|
||||
}
|
||||
TilesManager.ResetTileDatas();
|
||||
}
|
||||
|
||||
public void ResetData()
|
||||
|
||||
@ -90,6 +90,7 @@ public class SafeTile : Tile
|
||||
|
||||
public override void ResetTileData()
|
||||
{
|
||||
Debug.Log($"Resetting tile in safe tile {name}");
|
||||
if (playerTypesDict != null && playerTypesDict.Count > 0)
|
||||
{
|
||||
playerTypesDict.Clear();
|
||||
|
||||
@ -56,6 +56,7 @@ public class Tile : MonoBehaviour
|
||||
|
||||
public virtual void ResetTileData()
|
||||
{
|
||||
Debug.Log($"Resetting tile in parent tile {name}");
|
||||
if (HasPawnsAvailable)
|
||||
PlayerPawns.Clear();
|
||||
}
|
||||
|
||||
@ -77,6 +77,8 @@ public class TilesManager : MonoBehaviour, IBootLoader, IDataLoader, IBase
|
||||
finishingTileDataPairs.Clear();
|
||||
}
|
||||
|
||||
// causes null ref cast exception while player is moving.
|
||||
/*
|
||||
public void ResetTileData(PlayerType playerType, int currentTileIndex, PlayerState playerState)
|
||||
{
|
||||
if (playerState == PlayerState.InFinishingPath || playerState == PlayerState.HasFinished)
|
||||
@ -95,6 +97,21 @@ public class TilesManager : MonoBehaviour, IBootLoader, IDataLoader, IBase
|
||||
tile.ResetTileData();
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
public void ResetTileDatas()
|
||||
{
|
||||
foreach (var tile in generalTiles)
|
||||
tile.ResetTileData();
|
||||
|
||||
foreach (var pair in finishingTileDataPairs)
|
||||
{
|
||||
foreach (var tile in finishingTileDataPairs[pair.Key])
|
||||
{
|
||||
tile.ResetTileData();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public Vector3 GetAndInitPositionInsideSafeZone(PlayerPawn playerPawn, Tile targetTile, PlayerType currentPlayerTypeTurn)
|
||||
{
|
||||
|
||||
@ -46,12 +46,12 @@ public class UIManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
|
||||
public void UpdatePlayerTurnText(PlayerType type, int remSec)
|
||||
{
|
||||
screenManager.GetScreen<GameHUDS>(ScreenType.InGameHUDScreen).UpdatePlayerTurnText(type, remSec);
|
||||
screenManager.GetScreen<GameHUDScreen>(ScreenType.InGameHUDScreen).UpdatePlayerTurnText(type, remSec);
|
||||
}
|
||||
|
||||
public void UpdatePlayerTurnText(PlayerType type)
|
||||
{
|
||||
screenManager.GetScreen<GameHUDS>(ScreenType.InGameHUDScreen).UpdateBotTurnText(type);
|
||||
screenManager.GetScreen<GameHUDScreen>(ScreenType.InGameHUDScreen).UpdateBotTurnText(type);
|
||||
}
|
||||
|
||||
public void OnGameOver()
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using TMPro;
|
||||
using System.Collections;
|
||||
|
||||
public class GameHUDS : ScreenBase
|
||||
public class GameHUDScreen : ScreenBase
|
||||
{
|
||||
[Header("Buttons")]
|
||||
[SerializeField] private Button diceBtn;
|
||||
[SerializeField] private Button pauseBtn;
|
||||
|
||||
@ -55,11 +55,13 @@ public class GameHUDS : ScreenBase
|
||||
|
||||
public void UpdatePlayerTurnText(PlayerType playerType, int remSec)
|
||||
{
|
||||
Debug.Log($"UpdateTurnText: Player Turn :: {(PlayerColorType)((int)playerType)} ({remSec})");
|
||||
playerTurnText.text = $"Turn : {(PlayerColorType)((int)playerType)} ({remSec})";
|
||||
}
|
||||
|
||||
public void UpdateBotTurnText(PlayerType playerType)
|
||||
{
|
||||
Debug.Log($"UpdateTurnText: Bot Turn :: {(PlayerColorType)((int)playerType)}");
|
||||
playerTurnText.text = $"Turn : {(PlayerColorType)((int)playerType)}";
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user