private IEnumerator WaitExecute(int time, IGameStatesPT gS, int player) { yield return(new WaitForSeconds(time)); if (!IsEnd()) { ChangeState(gS); if (player == 2) { transform.GetComponent <GUIControllerScriptPT>().ViewMessage("Your Turn", 1, false); AddPowerPoints(1); transform.GetComponent <GUIControllerScriptPT>().LockUnlockPowers(true, powerPoints); } } else { ChangeState(new IEndStatePT()); } }
public void ChangeState(IGameStatesPT newState) { gameState = newState; gameState.OnStateEnter(this); }
public void Wait(int time, IGameStatesPT gS, int player) { StartCoroutine(WaitExecute(time, gS, player)); }