Esempio n. 1
0
 private void Awake()
 {
     agent = Instantiate(agentPrefab);
     agent.Init(board, 0);
     board.newTurn  += NewTurn;
     board.gameOver += GameOver;
 }
Esempio n. 2
0
 private void Reset()
 {
     agent.EndEpisode();
     Destroy(agent.gameObject);
     agent = Instantiate(agentPrefab);
     agent.Init(board, 0);
     board.ResetPieces();
 }
Esempio n. 3
0
 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);
     }
 }