diff --git a/Assets/Scripts/Gameplay/GameplayManager.cs b/Assets/Scripts/Gameplay/GameplayManager.cs index ac6eceb..071e54f 100644 --- a/Assets/Scripts/Gameplay/GameplayManager.cs +++ b/Assets/Scripts/Gameplay/GameplayManager.cs @@ -234,6 +234,7 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader public void InitCurrentGamePlayerInfo() { currentPlayerTypeTurn = allPlayerTypes[currentPlayerTurnIndex]; + uIManager.UpdatePlayerTurnText(currentPlayerTypeTurn); Debug.Log($"currentPlayerTypeTurn: {currentPlayerTypeTurn}"); #if UNITY_EDITOR diff --git a/Assets/Scripts/Gameplay/Player/PlayerBase.cs b/Assets/Scripts/Gameplay/Player/PlayerBase.cs index 3a6637a..20ae7f3 100644 --- a/Assets/Scripts/Gameplay/Player/PlayerBase.cs +++ b/Assets/Scripts/Gameplay/Player/PlayerBase.cs @@ -24,7 +24,7 @@ public class PlayerBase : MonoBehaviour { for (int idx = 0; idx < basePlacementDatas.Length; idx++) { - playerPawns[idx].Init(basePlacementDatas[idx], playerType); + playerPawns[idx].Init(this, basePlacementDatas[idx], playerType); } } diff --git a/Assets/Scripts/Gameplay/Player/PlayerPawn.cs b/Assets/Scripts/Gameplay/Player/PlayerPawn.cs index da17b42..8aa5c53 100644 --- a/Assets/Scripts/Gameplay/Player/PlayerPawn.cs +++ b/Assets/Scripts/Gameplay/Player/PlayerPawn.cs @@ -23,39 +23,17 @@ public class PlayerPawn : MonoBehaviour [SerializeField] private Animator animator; [SerializeField] private PlayerCountCanvas playerCountCanvas; - public PlayerCountCanvas PlayerCountCanvas => playerCountCanvas; - - public bool CanSelectPlayer - { - get; private set; - } - + private PlayerBase playerBase; 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 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 void AssignBotPlayerState(bool state) { @@ -120,8 +98,14 @@ public class PlayerPawn : MonoBehaviour // transform.LookAt(transform.position + lookDirection); transform.DOLookAt(transform.position + lookDirection, 0.2f); } - - onComplete?.Invoke(); + + Debug.Log($"Dotween:: MoveToTile.OnComplete {PlayerType}, {transform.position}: {StepsTaken != 0}"); + if (StepsTaken != 0) + onComplete?.Invoke(); + else + { + transform.position = playerBase.GetBasePlacementDataPosition(PlayerId - 1).position; + } }; } @@ -137,6 +121,7 @@ public class PlayerPawn : MonoBehaviour transform.position = transformData.position; transform.rotation = transformData.rotation; SetPlayerState(PlayerState.InHome); + ShowPlayerCountCanvas(false); StepsTaken = 0; } @@ -160,8 +145,9 @@ public class PlayerPawn : MonoBehaviour gameplayManager = gameplayManager ?? InterfaceManager.Instance.GetInterfaceInstance(); } - public void Init(BasePlacementData basePlacementData, PlayerType playerType) + public void Init(PlayerBase playerBase, BasePlacementData basePlacementData, PlayerType playerType) { + this.playerBase = playerBase; PlayerId = basePlacementData.playerBaseId; PlayerType = playerType;