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