Compare commits
No commits in common. "06821c003095e1f3e097f02fc906daf912a492a1" and "84c48d4adcf182d3d61584eaf2ce32dc1bb13d2b" have entirely different histories.
06821c0030
...
84c48d4adc
@ -8460,11 +8460,9 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: 0483b263e22fc433caab31141efbe319, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
isDebugAITest: 0
|
||||
isDebugPlayerTest: 0
|
||||
isDebugTest: 0
|
||||
diceRollHandler: {fileID: 1013177415}
|
||||
diceValue: 0
|
||||
botDiceRollDelay: 0.25
|
||||
maxDiceSixRollCounter: 2
|
||||
totalStepsForCharacter: 57
|
||||
diceText: {fileID: 953941044}
|
||||
@ -11559,7 +11557,7 @@ MonoBehaviour:
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
diceView: {fileID: 1619592888}
|
||||
diceTestValue: 0
|
||||
diceTestValue: 1
|
||||
--- !u!4 &1039618837 stripped
|
||||
Transform:
|
||||
m_CorrespondingSourceObject: {fileID: 5672526856521419272, guid: 4dc45edb05c8f4268aebcd5e9cbac783, type: 3}
|
||||
@ -15161,7 +15159,6 @@ MonoBehaviour:
|
||||
- {fileID: 1107252688}
|
||||
- {fileID: 1406544794}
|
||||
- {fileID: 884011400}
|
||||
enableLogs: 0
|
||||
--- !u!4 &1335794571
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -27896,7 +27893,7 @@ MonoBehaviour:
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: 652690593, guid: 1467c87c1b60f4707b78abdf2804ec02, type: 3}
|
||||
m_Sprite: {fileID: 457192420, guid: c657b4c04be754166a725c1b25fbea7d, type: 3}
|
||||
m_Type: 0
|
||||
m_PreserveAspect: 1
|
||||
m_FillCenter: 1
|
||||
|
||||
@ -24,11 +24,7 @@ public class BotModeData
|
||||
|
||||
public class GameModeHandler : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
{
|
||||
public GameplayManager GameplayManager
|
||||
{
|
||||
get; private set;
|
||||
}
|
||||
|
||||
private GameplayManager gameplayManager;
|
||||
private PVPModeData pvpModeData;
|
||||
private BotModeData botModeData;
|
||||
|
||||
@ -50,7 +46,7 @@ public class GameModeHandler : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
public void InitializeData()
|
||||
{
|
||||
GameManager = InterfaceManager.Instance.GetInterfaceInstance<GameManager>();
|
||||
GameplayManager = InterfaceManager.Instance.GetInterfaceInstance<GameplayManager>();
|
||||
gameplayManager = InterfaceManager.Instance.GetInterfaceInstance<GameplayManager>();
|
||||
}
|
||||
|
||||
public void InitPVPModeData(List<PlayerType> types, List<string> names)
|
||||
@ -61,7 +57,7 @@ public class GameModeHandler : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
};
|
||||
|
||||
CurrentGameModeType = GameModeType.PVP;
|
||||
GameplayManager.InitPlayerTypesForPVP(types, names);
|
||||
gameplayManager.InitPlayerTypesForPVP(types, names);
|
||||
}
|
||||
|
||||
public void InitBotModeData(PlayerData playerData, int botCount)
|
||||
@ -73,7 +69,7 @@ public class GameModeHandler : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
};
|
||||
|
||||
CurrentGameModeType = GameModeType.Bot;
|
||||
GameplayManager.InitPlayerTypesForBotMatch(playerData, botCount);
|
||||
gameplayManager.InitPlayerTypesForBotMatch(playerData, botCount);
|
||||
}
|
||||
|
||||
public void OnGameRestarted()
|
||||
|
||||
@ -61,11 +61,7 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
get; private set;
|
||||
}
|
||||
private UIManager uIManager;
|
||||
public GameManager GameManager
|
||||
{
|
||||
get; private set;
|
||||
}
|
||||
|
||||
private GameManager gameManager;
|
||||
private GameModeHandler gameModeHandler;
|
||||
|
||||
private int diceRolledValue;
|
||||
@ -74,7 +70,7 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
private int diceSixRollCounter = 0;
|
||||
|
||||
private List<PlayerPawn> availPlayers = new List<PlayerPawn>();
|
||||
private bool canSwitchPlayer = true;
|
||||
private bool canSwitchPlayer = false;
|
||||
|
||||
public bool CanRollDiceForUser
|
||||
{
|
||||
@ -89,8 +85,6 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
public List<PlayerData> PlayerDatas => playerDatas;
|
||||
public List<PlayerType> PlayerTypesCollection => allPlayerTypes;
|
||||
|
||||
public Action OnGameResumed = null;
|
||||
|
||||
public void Initialize()
|
||||
{
|
||||
InterfaceManager.Instance?.RegisterInterface<GameplayManager>(this);
|
||||
@ -101,7 +95,7 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
{
|
||||
TilesManager = InterfaceManager.Instance.GetInterfaceInstance<TilesManager>();
|
||||
uIManager = InterfaceManager.Instance.GetInterfaceInstance<UIManager>();
|
||||
GameManager = InterfaceManager.Instance.GetInterfaceInstance<GameManager>();
|
||||
gameManager = InterfaceManager.Instance.GetInterfaceInstance<GameManager>();
|
||||
gameModeHandler = InterfaceManager.Instance.GetInterfaceInstance<GameModeHandler>();
|
||||
}
|
||||
|
||||
@ -234,7 +228,6 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
public void InitCurrentGamePlayerInfo()
|
||||
{
|
||||
currentPlayerTypeTurn = allPlayerTypes[currentPlayerTurnIndex];
|
||||
uIManager.UpdatePlayerTurnText(currentPlayerTypeTurn);
|
||||
Debug.Log($"currentPlayerTypeTurn: {currentPlayerTypeTurn}");
|
||||
|
||||
#if UNITY_EDITOR
|
||||
@ -354,18 +347,23 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
UpdateActivePlayersAndSetDisplay(true);
|
||||
}
|
||||
|
||||
if (CanRollDiceAgain) // got a 6 roll value
|
||||
if (availPlayers.Count() < 1 && CanRollDiceAgain) // got a 6 roll value
|
||||
{
|
||||
pawn = playerGameDatasDict[currentPlayerTypeTurn].playerPawnsDict.Values.FirstOrDefault(pawn => pawn.GetPlayerState() == PlayerState.InHome);
|
||||
|
||||
if (pawn != null)
|
||||
{
|
||||
Debug.Log($"SelectedPawn: {pawn.name}");
|
||||
OnPawnSelected(pawn);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// TODO :: Double check
|
||||
foreach (var key in botPawnsDictForCurrentPlayer.Keys)
|
||||
{
|
||||
Debug.Log($"b :: botPawnsDictForCurrentPlayer[key]: {key}, {botPawnsDictForCurrentPlayer[key]}");
|
||||
// botPawnsDictForCurrentPlayer[key] = BotMove.NoMoves;
|
||||
}
|
||||
|
||||
|
||||
Debug.Log($"Before Iterating");
|
||||
foreach (var playerPawn in availPlayers)
|
||||
{
|
||||
@ -520,13 +518,7 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
availPlayers = new List<PlayerPawn>();
|
||||
|
||||
if (!CanRollDiceAgain)
|
||||
{
|
||||
UpdateActivePlayersAndSetDisplay(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
InitActivePlayers();
|
||||
}
|
||||
|
||||
if (rolledVal == Ludo_3D_Constants.Max_Dice_Rolls)
|
||||
{
|
||||
@ -579,7 +571,6 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
{
|
||||
indexesToRemove.Add(i);
|
||||
availPlayers[i].SetPlayerSelectionState(false);
|
||||
availPlayers[i].ShowPlayerCountCanvas(false);
|
||||
customAvailPlayers--;
|
||||
}
|
||||
|
||||
@ -602,17 +593,13 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
}
|
||||
|
||||
private void UpdateActivePlayersAndSetDisplay(bool state)
|
||||
{
|
||||
InitActivePlayers();
|
||||
SetDisplayCountForAllAvailPlayers(state);
|
||||
}
|
||||
|
||||
private void InitActivePlayers()
|
||||
{
|
||||
availPlayers = playerGameDatasDict[currentPlayerTypeTurn].playerPawnsDict.Values.Select(pawn => pawn)
|
||||
.Where(pawn => pawn.GetPlayerState() == PlayerState.InSafeZone ||
|
||||
pawn.GetPlayerState() == PlayerState.Moving ||
|
||||
pawn.GetPlayerState() == PlayerState.InFinishingPath).ToList();
|
||||
|
||||
SetDisplayCountForAllAvailPlayers(state);
|
||||
}
|
||||
|
||||
private bool AreAllPawnsInFinishingPath()
|
||||
@ -666,6 +653,7 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
PlayerGameData playerGameData = playerGameDatasDict[currentPlayerTypeTurn];
|
||||
Debug.Log($"playerPawn.GetPlayerState(): {selectedPawn.GetPlayerState()}");
|
||||
|
||||
|
||||
if (selectedPawn.GetPlayerState() == PlayerState.InHome)
|
||||
{
|
||||
Tile targetTile = TilesManager.RetrieveTileBasedOnIndex(playerGameData.startIndex);
|
||||
@ -733,13 +721,6 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
foreach (var pawn in playerPawnsTest)
|
||||
pawn.MoveToCustomTilePosition(currentSittingSafeTile.CenterPlacementPosition);
|
||||
}
|
||||
|
||||
if (currentSittingSafeTile.ContainsPlayerType(currentPlayerTypeTurn))
|
||||
{
|
||||
var playerPawns = currentSittingSafeTile.GetPlayerPawns(currentPlayerTypeTurn);
|
||||
foreach (var pawn in playerPawns)
|
||||
ShowUpdatedPlayerCountOnTile(pawn);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -886,14 +867,14 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
{
|
||||
// MoveThroughTiles(playerPawn, index, targetIndex);
|
||||
Debug.Log($"TargetIdx: {targetIndex - index}");
|
||||
CheckForGamePause(() => MoveThroughFinishingPath(playerPawn, 0, targetIndex - index));
|
||||
MoveThroughFinishingPath(playerPawn, 0, targetIndex - index);
|
||||
}
|
||||
else if (nextTileIndex <= targetIndex)
|
||||
{
|
||||
if (nextTileIndex == 0)
|
||||
targetIndex = (targetIndex - playerPawn.CurrentTileIndex) - 1;
|
||||
|
||||
CheckForGamePause(() => MoveThroughTiles(playerPawn, nextTileIndex, targetIndex));
|
||||
MoveThroughTiles(playerPawn, nextTileIndex, targetIndex);
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -957,20 +938,6 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
index);
|
||||
}
|
||||
|
||||
public void CheckForGamePause(Action onComplete)
|
||||
{
|
||||
Debug.Log($"CheckForGamePause: {GameManager.CurrentGameState == GameState.IsPaused}");
|
||||
if (gameModeHandler.CurrentGameModeType == GameModeType.Bot && !botTypesInGame.Contains(currentPlayerTypeTurn)
|
||||
&& GameManager.CurrentGameState == GameState.IsPaused)
|
||||
{
|
||||
OnGameResumed = onComplete;
|
||||
}
|
||||
else
|
||||
{
|
||||
onComplete?.Invoke();
|
||||
}
|
||||
}
|
||||
|
||||
private void MoveThroughFinishingPath(PlayerPawn playerPawn, int index, int targetIndex)
|
||||
{
|
||||
UpdatePlayerState(playerPawn, PlayerState.InFinishingPath);
|
||||
@ -988,14 +955,14 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
Debug.Log($"tileIndex: {tileIndex}, targetIndex: {targetIndex}");
|
||||
if (tileIndex <= targetIndex)
|
||||
{
|
||||
CheckForGamePause(() => MoveThroughFinishingPath(playerPawn, tileIndex, targetIndex));
|
||||
// MoveThroughTiles(playerPawn, index, targetIndex);
|
||||
MoveThroughFinishingPath(playerPawn, tileIndex, targetIndex);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (playerPawn.CurrentTileIndex == TilesManager.GetFinishingTileDataLength(currentPlayerTypeTurn) - 1)
|
||||
{
|
||||
OnGameResumed = null;
|
||||
Tile tile = TilesManager.RetrieveFinishingTileBasedOnIndex(playerPawn.PlayerType, playerPawn.CurrentTileIndex);
|
||||
tile.InitPlayerPawn(playerPawn, playerPawn.PlayerType);
|
||||
// ShowUpdatedPlayerCountOnTile(playerPawn);
|
||||
@ -1028,7 +995,7 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
playerDatas.FirstOrDefault(data => data.playerType == lastUnfinishingPlayerType).ranking = TotalPlayersInGame - allPlayerTypes.Count;
|
||||
|
||||
// Show Game Over panel
|
||||
GameManager.OnGameStateChanged(GameState.GameOver);
|
||||
gameManager.OnGameStateChanged(GameState.GameOver);
|
||||
|
||||
return;
|
||||
}
|
||||
@ -1110,7 +1077,6 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
{
|
||||
ResetGameRestartData();
|
||||
|
||||
OnGameResumed = null;
|
||||
playerDatas = null;
|
||||
allPlayerTypes = null;
|
||||
|
||||
@ -1125,6 +1091,5 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
public void ResetGameRestartData()
|
||||
{
|
||||
currentPlayerTurnIndex = 0;
|
||||
diceSixRollCounter = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -24,7 +24,7 @@ public class PlayerBase : MonoBehaviour
|
||||
{
|
||||
for (int idx = 0; idx < basePlacementDatas.Length; idx++)
|
||||
{
|
||||
playerPawns[idx].Init(this, basePlacementDatas[idx], playerType);
|
||||
playerPawns[idx].Init(basePlacementDatas[idx], playerType);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -23,17 +23,39 @@ public class PlayerPawn : MonoBehaviour
|
||||
[SerializeField] private Animator animator;
|
||||
[SerializeField] private PlayerCountCanvas playerCountCanvas;
|
||||
|
||||
private PlayerBase playerBase;
|
||||
private GameplayManager gameplayManager;
|
||||
|
||||
public PlayerCountCanvas PlayerCountCanvas => playerCountCanvas;
|
||||
|
||||
public int PlayerId { get; private set; }
|
||||
public int StepsTaken { get; private set; }
|
||||
public int CurrentTileIndex { get; private set; }
|
||||
public bool IsBotPlayer { get; private set; }
|
||||
public bool CanSelectPlayer { get; private set; }
|
||||
public PlayerType PlayerType { get; private set; }
|
||||
public bool CanSelectPlayer
|
||||
{
|
||||
get; private set;
|
||||
}
|
||||
|
||||
private GameplayManager gameplayManager;
|
||||
|
||||
public int CurrentTileIndex
|
||||
{
|
||||
get; private set;
|
||||
}
|
||||
|
||||
public int PlayerId
|
||||
{
|
||||
get; private set;
|
||||
}
|
||||
|
||||
public PlayerType PlayerType
|
||||
{
|
||||
get; private set;
|
||||
}
|
||||
|
||||
public bool IsBotPlayer
|
||||
{
|
||||
get; private set;
|
||||
}
|
||||
|
||||
public int StepsTaken
|
||||
{
|
||||
get; private set;
|
||||
}
|
||||
|
||||
public void AssignBotPlayerState(bool state)
|
||||
{
|
||||
@ -99,13 +121,7 @@ public class PlayerPawn : MonoBehaviour
|
||||
transform.DOLookAt(transform.position + lookDirection, 0.2f);
|
||||
}
|
||||
|
||||
Debug.Log($"Dotween:: MoveToTile.OnComplete {PlayerType}, {transform.position}: {StepsTaken != 0}");
|
||||
if (StepsTaken != 0)
|
||||
onComplete?.Invoke();
|
||||
else
|
||||
{
|
||||
transform.position = playerBase.GetBasePlacementDataPosition(PlayerId - 1).position;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@ -121,7 +137,6 @@ public class PlayerPawn : MonoBehaviour
|
||||
transform.position = transformData.position;
|
||||
transform.rotation = transformData.rotation;
|
||||
SetPlayerState(PlayerState.InHome);
|
||||
ShowPlayerCountCanvas(false);
|
||||
StepsTaken = 0;
|
||||
}
|
||||
|
||||
@ -134,9 +149,9 @@ public class PlayerPawn : MonoBehaviour
|
||||
|
||||
private void OnMouseDown()
|
||||
{
|
||||
SetGameplayManager();
|
||||
if (gameplayManager.GameManager.CurrentGameState == GameState.IsPaused || IsBotPlayer || !CanSelectPlayer) return;
|
||||
if (IsBotPlayer || !CanSelectPlayer) return;
|
||||
|
||||
SetGameplayManager();
|
||||
gameplayManager.OnPawnSelected(this);
|
||||
}
|
||||
|
||||
@ -145,9 +160,8 @@ public class PlayerPawn : MonoBehaviour
|
||||
gameplayManager = gameplayManager ?? InterfaceManager.Instance.GetInterfaceInstance<GameplayManager>();
|
||||
}
|
||||
|
||||
public void Init(PlayerBase playerBase, BasePlacementData basePlacementData, PlayerType playerType)
|
||||
public void Init(BasePlacementData basePlacementData, PlayerType playerType)
|
||||
{
|
||||
this.playerBase = playerBase;
|
||||
PlayerId = basePlacementData.playerBaseId;
|
||||
PlayerType = playerType;
|
||||
|
||||
|
||||
@ -4,7 +4,6 @@ public enum GameState
|
||||
{
|
||||
InMenu,
|
||||
InGame,
|
||||
IsPaused,
|
||||
GameOver,
|
||||
}
|
||||
|
||||
@ -15,7 +14,7 @@ public class GameManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
private MusicManager musicManager;
|
||||
private GameplayManager gameplayManager;
|
||||
|
||||
public GameState CurrentGameState
|
||||
public GameState GameState
|
||||
{
|
||||
get; private set;
|
||||
}
|
||||
@ -37,16 +36,10 @@ public class GameManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
OnGameStateChanged(GameState.InMenu);
|
||||
}
|
||||
|
||||
public void SetGameState(GameState gameState)
|
||||
{
|
||||
Debug.Log($"### GameState: {gameState}");
|
||||
PrevGameState = CurrentGameState;
|
||||
CurrentGameState = gameState;
|
||||
}
|
||||
|
||||
public void OnGameStateChanged(GameState gameState)
|
||||
{
|
||||
SetGameState(gameState);
|
||||
PrevGameState = GameState;
|
||||
GameState = gameState;
|
||||
Debug.Log($"OnGameStateChanged: {gameState}");
|
||||
switch (gameState)
|
||||
{
|
||||
@ -56,12 +49,8 @@ public class GameManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
uiManager.OnInMenuScreen();
|
||||
break;
|
||||
case GameState.InGame:
|
||||
Debug.Log($"Logging in-game state");
|
||||
musicManager.PlayMusicClip(MusicType.GameMusic);
|
||||
uiManager.OnInGameScreen();
|
||||
break;
|
||||
case GameState.IsPaused:
|
||||
|
||||
break;
|
||||
case GameState.GameOver:
|
||||
musicManager.PlayMusicClip(MusicType.GameOverMusic);
|
||||
|
||||
@ -2,16 +2,10 @@ using UnityEngine;
|
||||
|
||||
public class UIManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
{
|
||||
private GameplayManager gameplayManager;
|
||||
private ScreenManager screenManager;
|
||||
private PopupManager popupManager;
|
||||
|
||||
private GameplayManager gameplayManager;
|
||||
|
||||
public GameManager GameManager
|
||||
{
|
||||
get; private set;
|
||||
}
|
||||
|
||||
public void Initialize()
|
||||
{
|
||||
InterfaceManager.Instance.RegisterInterface<UIManager>(this);
|
||||
@ -19,9 +13,8 @@ public class UIManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
|
||||
public void InitializeData()
|
||||
{
|
||||
GameManager = InterfaceManager.Instance.GetInterfaceInstance<GameManager>();
|
||||
popupManager = InterfaceManager.Instance.GetInterfaceInstance<PopupManager>();
|
||||
gameplayManager = InterfaceManager.Instance.GetInterfaceInstance<GameplayManager>();
|
||||
popupManager = InterfaceManager.Instance.GetInterfaceInstance<PopupManager>();
|
||||
}
|
||||
|
||||
public void OnDiceViewInteracted()
|
||||
|
||||
@ -8,7 +8,7 @@ public class PauseMenuPopup : PopupBase
|
||||
[SerializeField] private Button playBtn;
|
||||
[SerializeField] private Button restartBtn;
|
||||
|
||||
private UIManager uiManager;
|
||||
private GameManager gameManager;
|
||||
private SoundManager soundManager;
|
||||
private GameModeHandler gameModeHandler;
|
||||
|
||||
@ -28,9 +28,6 @@ public class PauseMenuPopup : PopupBase
|
||||
|
||||
private void OnClick_PlayButton()
|
||||
{
|
||||
SetUIManager();
|
||||
uiManager.GameManager.SetGameState(GameState.InGame);
|
||||
|
||||
soundManager = soundManager == null ? InterfaceManager.Instance?.GetInterfaceInstance<SoundManager>() : soundManager;
|
||||
soundManager?.PlayGameSoundClip(SoundType.ButtonClick);
|
||||
|
||||
@ -38,9 +35,6 @@ public class PauseMenuPopup : PopupBase
|
||||
|
||||
ScreenManager screenManager = InterfaceManager.Instance?.GetInterfaceInstance<ScreenManager>();
|
||||
screenManager.ShowScreen(ScreenType.InGameHUDScreen);
|
||||
|
||||
SetGameModeHandler();
|
||||
gameModeHandler.GameplayManager.OnGameResumed?.Invoke();
|
||||
}
|
||||
|
||||
private void OnClick_HomeButton()
|
||||
@ -50,13 +44,8 @@ public class PauseMenuPopup : PopupBase
|
||||
|
||||
popupManager.HidePopup(popupType);
|
||||
|
||||
SetUIManager();
|
||||
uiManager.GameManager.OnGameStateChanged(GameState.InMenu);
|
||||
}
|
||||
|
||||
private void SetUIManager()
|
||||
{
|
||||
uiManager = uiManager == null ? InterfaceManager.Instance?.GetInterfaceInstance<UIManager>() : uiManager;
|
||||
gameManager = InterfaceManager.Instance?.GetInterfaceInstance<GameManager>();
|
||||
gameManager.OnGameStateChanged(GameState.InMenu);
|
||||
}
|
||||
|
||||
private void OnClick_RestartButton()
|
||||
|
||||
@ -17,40 +17,31 @@ public class GameHUDS : ScreenBase
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
pauseBtn.onClick.AddListener(OnClick_PauseButton);
|
||||
diceBtn.onClick.AddListener(OnClick_DiceButton);
|
||||
pauseBtn.onClick.AddListener(OnClick_pauseBtn);
|
||||
diceBtn.onClick.AddListener(OnClick_DiceBtn);
|
||||
}
|
||||
|
||||
private void OnDisable()
|
||||
{
|
||||
pauseBtn.onClick.RemoveListener(OnClick_PauseButton);
|
||||
diceBtn.onClick.RemoveListener(OnClick_DiceButton);
|
||||
pauseBtn.onClick.RemoveListener(OnClick_pauseBtn);
|
||||
diceBtn.onClick.RemoveListener(OnClick_DiceBtn);
|
||||
}
|
||||
|
||||
private void OnClick_PauseButton()
|
||||
private void OnClick_pauseBtn()
|
||||
{
|
||||
soundManager = soundManager == null ? InterfaceManager.Instance?.GetInterfaceInstance<SoundManager>() : soundManager;
|
||||
soundManager?.PlayGameSoundClip(SoundType.ButtonClick);
|
||||
|
||||
screenManager.HideScreen(screenType);
|
||||
|
||||
PopupManager popupManager = InterfaceManager.Instance?.GetInterfaceInstance<PopupManager>();
|
||||
popupManager.ShowPopup(PopupType.PauseMenuPopup);
|
||||
|
||||
SetUIManager();
|
||||
uiManager.GameManager.SetGameState(GameState.IsPaused);
|
||||
soundManager = soundManager == null ? InterfaceManager.Instance?.GetInterfaceInstance<SoundManager>() : soundManager;
|
||||
soundManager?.PlayGameSoundClip(SoundType.ButtonClick);
|
||||
|
||||
Hide();
|
||||
}
|
||||
|
||||
private void OnClick_DiceButton()
|
||||
{
|
||||
SetUIManager();
|
||||
|
||||
uiManager.OnDiceViewInteracted();
|
||||
}
|
||||
|
||||
private void SetUIManager()
|
||||
private void OnClick_DiceBtn()
|
||||
{
|
||||
uiManager = uiManager == null ? InterfaceManager.Instance?.GetInterfaceInstance<UIManager>() : uiManager;
|
||||
uiManager.OnDiceViewInteracted();
|
||||
}
|
||||
|
||||
public void UpdatePlayerTurnText(PlayerType playerType)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user