private void Awake() { agent = Instantiate(agentPrefab); agent.Init(board, 0); board.newTurn += NewTurn; board.gameOver += GameOver; }
private void Reset() { agent.EndEpisode(); Destroy(agent.gameObject); agent = Instantiate(agentPrefab); agent.Init(board, 0); board.ResetPieces(); }
private void SpawnAI() { if (whiteAI) { if (whiteAgent != null) { Destroy(whiteAgent.gameObject); } whiteAgent = Instantiate(agentPrefab); whiteAgent.Init(board, 0); } if (blackAI) { if (blackAgent != null) { Destroy(blackAgent.gameObject); } blackAgent = Instantiate(agentPrefab); blackAgent.Init(board, 1); } }