private void LateUpdate() { if (GameStateManager.Instance.MatchType != MatchTypes.Singleplayer) { return; } if (TurnManager.Instance.TurnCount == 0 && GameStateManager.Instance.IsCurrentPlayerAI()) { PreGameAI tool = new PreGameAI(DeploymentPanel); tool.PositionUnits(); endButton.OK(); } if (VictoryLossChecker.HasGameEnded() || /*QCManager.QCisHappening ||*/ GameStateManager.Instance.GameState == GameStates.AnimatingState || GameStateManager.Instance.IsItPreGame() || actionCooldown || GameStateManager.Instance.IsCurrentPlayerAI() == false) { return; } // Already we know it is decisionmaking moment! // If green player has tim,e to move and he is an AI, do AI. if (CheckIfTimeForAI(0)) { ChangeAIToAppropriateOne(0); PlayerAIs[0].DoAI(); } if (CheckIfTimeForAI(1)) { ChangeAIToAppropriateOne(1); PlayerAIs[1].DoAI(); } if (GameStateManager.Instance.GameState == GameStates.RetaliationState && IsCurrentTurnHuman() && isRetaliating == false) { isRetaliating = true; CombatController.Instance.RetaliationForAI(); } }
public void UsePreGameAIForHuman() { FindObjectOfType <CancelUnitsDeployment>().CommandCancel(); var temp = new PreGameAI(DeploymentPanel); temp.PositionUnits(); }
public void OnPointerDown(PointerEventData eventData) { if (wasClickedThisSecond == false) { foreach (DragableUnitIcon DUI in FindObjectsOfType <DragableUnitIcon>()) { DUI.wasClickedThisSecond = false; } wasClickedThisSecond = true; timeSinceClick = 0; } else { foreach (DragableUnitIcon DUI in FindObjectsOfType <DragableUnitIcon>()) { DUI.wasClickedThisSecond = false; } wasClickedThisSecond = false; timeSinceClick = 0; PreGameAI tool = new PreGameAI(FindObjectOfType <AI_Controller>().DeploymentPanel); tool.Position(me, tool.ChooseTheTile(me)); Destroy(this.gameObject); } }