[Feat] 기보씬 이전, 다음 버튼 구현
This commit is contained in:
parent
e0568fe3c9
commit
a1ec4e996a
@ -39,9 +39,6 @@ public class GameManagerTestLIN : Singleton<GameManagerTestLIN>
|
||||
|
||||
|
||||
//게임 씬에서 확인하기 위한 임시 코드
|
||||
_stoneController = GameObject.FindObjectOfType<StoneController>();
|
||||
_stoneController.InitStones();
|
||||
_gameLogic = new GameLogic(_stoneController, _gameType);
|
||||
}
|
||||
|
||||
private void TryAutoSignin()
|
||||
@ -142,6 +139,12 @@ public class GameManagerTestLIN : Singleton<GameManagerTestLIN>
|
||||
_stoneController.InitStones();
|
||||
_gameLogic = new GameLogic(_stoneController, _gameType);
|
||||
}
|
||||
else if (scene.name == "Replay")
|
||||
{
|
||||
_stoneController = GameObject.FindObjectOfType<StoneController>();
|
||||
_stoneController.InitStones();
|
||||
_gameLogic = new GameLogic(_stoneController, Enums.GameType.Replay);
|
||||
}
|
||||
_canvas = GameObject.Find("Canvas").GetComponent<Canvas>();
|
||||
}
|
||||
}
|
@ -18567,7 +18567,7 @@ GameObject:
|
||||
- component: {fileID: 1366478885779137686}
|
||||
- component: {fileID: 6113787613455091454}
|
||||
m_Layer: 5
|
||||
m_Name: '[Canvas] Replay UI'
|
||||
m_Name: Canvas
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
|
@ -27,7 +27,7 @@ public abstract class Singleton<T> : MonoBehaviour where T : Component
|
||||
}
|
||||
}
|
||||
|
||||
private void Awake()
|
||||
protected void Awake()
|
||||
{
|
||||
if (_instance == null)
|
||||
{
|
||||
|
@ -37,6 +37,8 @@ public class GameManager : Singleton<GameManager>
|
||||
}
|
||||
//게임 씬에서 확인하기 위한 임시 코드
|
||||
_gameType = Enums.GameType.SinglePlay;
|
||||
|
||||
base.Awake();
|
||||
}
|
||||
|
||||
private void Start()
|
||||
@ -207,18 +209,6 @@ public class GameManager : Singleton<GameManager>
|
||||
|
||||
public void ReplayNext(Move nextMove )
|
||||
{
|
||||
if (_gameLogic == null)
|
||||
{
|
||||
_gameLogic = new GameLogic(_stoneController, Enums.GameType.Replay);
|
||||
}
|
||||
|
||||
if (_stoneController == null)
|
||||
{
|
||||
_stoneController = GameObject.FindObjectOfType<StoneController>();
|
||||
_stoneController.InitStones();
|
||||
Debug.Log("스톤컨트롤러 재할당");
|
||||
}
|
||||
|
||||
// 보드에 돌을 설정하기 위해 gameLogic의 SetNewBoardValue호출
|
||||
if (nextMove.stoneType.Equals(Enums.StoneType.Black.ToString()))
|
||||
{
|
||||
@ -235,18 +225,6 @@ public class GameManager : Singleton<GameManager>
|
||||
|
||||
public void ReplayUndo(Move targetMove)
|
||||
{
|
||||
if (_gameLogic == null)
|
||||
{
|
||||
_gameLogic = new GameLogic(_stoneController, Enums.GameType.Replay);
|
||||
}
|
||||
|
||||
if (_stoneController == null)
|
||||
{
|
||||
_stoneController = GameObject.FindObjectOfType<StoneController>();
|
||||
_stoneController.InitStones();
|
||||
Debug.Log("스톤컨트롤러 재할당");
|
||||
}
|
||||
|
||||
if (targetMove.stoneType.Equals(Enums.StoneType.Black.ToString()))
|
||||
{
|
||||
_gameLogic.SetNewBoardValue(Enums.PlayerType.PlayerA, targetMove.columnIndex, targetMove.rowIndex);
|
||||
|
Loading…
x
Reference in New Issue
Block a user