diff --git a/Assets/Scenes/Game.unity b/Assets/Scenes/Game.unity index 326824e..29b8a13 100644 --- a/Assets/Scenes/Game.unity +++ b/Assets/Scenes/Game.unity @@ -8462,7 +8462,7 @@ MonoBehaviour: m_EditorClassIdentifier: isDebugTest: 1 diceRollHandler: {fileID: 1013177415} - diceValue: 6 + diceValue: 0 maxDiceSixRollCounter: 2 totalStepsForCharacter: 57 diceText: {fileID: 953941044} @@ -23841,7 +23841,7 @@ GameObject: - component: {fileID: 5608193481667689438} - component: {fileID: 5608193481667689409} m_Layer: 5 - m_Name: Menu HUD Screen + m_Name: MainMenuScreen m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -24581,7 +24581,7 @@ GameObject: - component: {fileID: 5608193481910428234} - component: {fileID: 5608193481910428235} m_Layer: 5 - m_Name: MainMenuScreen + m_Name: MenuScreens m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -24609,6 +24609,8 @@ MonoBehaviour: m_EditorClassIdentifier: screenType: 6 shouldFade: 0 + playBtn: {fileID: 0} + closeBtn: {fileID: 0} --- !u!224 &5608193481924487018 RectTransform: m_ObjectHideFlags: 0 diff --git a/Assets/Scripts/Gameplay/GameplayManager.cs b/Assets/Scripts/Gameplay/GameplayManager.cs index 37fcf45..7293d4b 100644 --- a/Assets/Scripts/Gameplay/GameplayManager.cs +++ b/Assets/Scripts/Gameplay/GameplayManager.cs @@ -52,6 +52,7 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader private TilesManager tilesManager; private UIManager uIManager; private GameManager gameManager; + private GameModeHandler gameModeHandler; private int diceRolledValue; @@ -85,12 +86,13 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader tilesManager = InterfaceManager.Instance.GetInterfaceInstance(); uIManager = InterfaceManager.Instance.GetInterfaceInstance(); gameManager = InterfaceManager.Instance.GetInterfaceInstance(); + gameModeHandler = InterfaceManager.Instance.GetInterfaceInstance(); } public void InitPlayerTypesForPVP(List types, List names) { allPlayerTypes = new List(types); - playerDatas.Clear(); + playerDatas = new List(); TotalPlayersInGame = types.Count; @@ -504,7 +506,7 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader Debug.Log($"### AreAllPawnsInFinishingPath"); if (AreAllPawnsInFinishingPath()) { - SetCanRollDiceForUser(!botTypesInGame.Contains(currentPlayerTypeTurn)); + SetCanRollDiceForUser(gameModeHandler.CurrentGameModeType != GameModeType.Bot || !botTypesInGame.Contains(currentPlayerTypeTurn)); return; } @@ -782,17 +784,17 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader UpdateActivePlayersAndSetDisplay(); } - - SetCanRollDiceForUser(!botTypesInGame.Contains(currentPlayerTypeTurn)); + Debug.Log($"CurrentPlayerTurn: {currentPlayerTypeTurn}"); + SetCanRollDiceForUser(gameModeHandler.CurrentGameModeType != GameModeType.Bot || !botTypesInGame.Contains(currentPlayerTypeTurn)); SetCurrentSelectedPointer(); pointerMeshRend.material = turnMat; // pointerMeshRend.materials[0] = turnMat; - Debug.Log($"botTypesInGame.Contains(currentPlayerTypeTurn): {botTypesInGame.Contains(currentPlayerTypeTurn)}"); + // Debug.Log($"botTypesInGame.Contains(currentPlayerTypeTurn): {botTypesInGame.Contains(currentPlayerTypeTurn)}"); - if (botTypesInGame.Contains(currentPlayerTypeTurn)) // TODO :: Double check calling of the function + if (gameModeHandler.CurrentGameModeType == GameModeType.Bot && botTypesInGame.Contains(currentPlayerTypeTurn)) // TODO :: Double check calling of the function { Debug.Log($"Invoking RollDiceForBot"); Invoke(nameof(HandleDiceRoll), 1f); @@ -1103,13 +1105,14 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader ResetGameRestartData(); playerDatas = null; - botTypesInGame = null; allPlayerTypes = null; - botRuntimeMovementData = null; playerGameDatasDict = null; playerDatas = null; availPlayers = null; + + botTypesInGame = null; + botRuntimeMovementData = null; } public void ResetGameRestartData() diff --git a/Assets/Scripts/State/GameManager.cs b/Assets/Scripts/State/GameManager.cs index 1379512..35be552 100644 --- a/Assets/Scripts/State/GameManager.cs +++ b/Assets/Scripts/State/GameManager.cs @@ -35,6 +35,7 @@ public class GameManager : MonoBehaviour, IBase, IBootLoader, IDataLoader public void OnGameStateChanged(GameState gameState) { GameState = gameState; + Debug.Log($"OnGameStateChanged: {gameState}"); switch (gameState) { case GameState.InMenu: diff --git a/Assets/Scripts/UI/Pages/PopUp/PvPModePopup.cs b/Assets/Scripts/UI/Pages/PopUp/PvPModePopup.cs index 2d16876..2b01ace 100644 --- a/Assets/Scripts/UI/Pages/PopUp/PvPModePopup.cs +++ b/Assets/Scripts/UI/Pages/PopUp/PvPModePopup.cs @@ -39,6 +39,7 @@ public class PvPModePopup : PopupBase private ScreenManager screenManager; private SoundManager soundManager; + private GameManager gameManager; private GameModeHandler gameModeHandler; private int selectedPlayerCount; @@ -151,6 +152,9 @@ public class PvPModePopup : PopupBase gameModeHandler = gameModeHandler == null ? InterfaceManager.Instance.GetInterfaceInstance() : gameModeHandler; gameModeHandler.InitPVPModeData(playerNameMap.Keys.ToList(), playerNameMap.Values.ToList()); + + gameManager = gameManager == null ? InterfaceManager.Instance.GetInterfaceInstance() : gameManager; + gameManager.OnGameStateChanged(GameState.InGame); } private void OnClick_SwitchButton()