// Use this for initialization void Start() { activeState = 0; //Camera.main.GetComponent<CameraMovement>().target = LevelGenerator.Instance.flagPoint.transform; setState(MatchRuntimeStates.none); teamsTurn = Teams.blue; if (automaticStateSwitch) { setState(MatchRuntimeStates.initMatch, 2); } }
IEnumerator StateDelay(MatchRuntimeStates _state, float delay) { yield return(new WaitForSeconds(delay)); ActiveState = _state; }
private void setState(MatchRuntimeStates _state, float _delay = 0) { StartCoroutine(StateDelay(_state, _delay)); }