void Update() { if (Score.wscore == 2) { //Debug.Log("WINNER!"); //UnityEditor.EditorApplication.isPlaying = false; winPanel.SetActive(true); winText.text = Score.playernamestr1 + "\n Winner"; playerTurn = true; } else if (Score.bscore == 2) { winPanel.SetActive(true); winText.text = Score.playernamestr2 + "\n Winner"; } if (!playerTurn && timer < 3) { timer += Time.deltaTime; } else if (!playerTurn && timer >= 3) { Move move = ab.GetMove(); _DoAIMove(move); timer = 0; } }
public static void Main() { if (DEBUG) { Console.SetIn(new StreamReader("test.map")); } while (true) { board.Initialize(); board.MakeMove(strategy.GetMove(board)); } }
void Update() { if (_kingDead) { Debug.Log("WINNER!"); //UnityEditor.EditorApplication.isPlaying = false; Application.Quit(); } if (!playerTurn) { Move_new move = ab.GetMove(); //Debug.Log(move.secondPosition.Position.x); //Debug.Log(move.secondPosition.Position.y); _DoAIMove(move); } }
void Update() { if (_kingDead) { Debug.Log("WINNER!"); //UnityEditor.EditorApplication.isPlaying = false; Application.Quit(); } if (!playerTurn && timer < 3) { timer += Time.deltaTime; } else if (!playerTurn && timer >= 3) { Move move = ab.GetMove(); _DoAIMove(move); timer = 0; } }
void Update() { if (_kingDead) { Debug.Log(@"WINNER!"); //UnityEditor.EditorApplication.isPlaying = false; Clean(); Application.Quit(); } if (!playerTurn && timer < 3) { timer += Time.deltaTime; timerAI = 0; } else if (!playerTurn && timer >= 3) { timerAI += Time.deltaTime; Move move = ab.GetMove(); _DoAIMove(move); StartCoroutine(ResumeClock()); timer = 0; } }
//调用AI public void AIMove() { Move move = ab.GetMove(); _DoAIMove(move); }