void Update() { newState = currentState.DoState(this); if (newState != currentState) { currentState = newState; currentState.InitState(this); } }
void Start() { currentState = playerTurnState; isPlayerTurn = true; currentState.InitState(this); FindObjectOfType <UI_AnimController>().skipTurnDelegate += () => isPlayerTurn = false; FindObjectOfType <BossStateManager>().endBossTurn += () => isPlayerTurn = true; //go create the enemyAISTATE MACHINE. //FindObjectOfType<EnemyAIStateMachine>().attackOverDelegate += () => isPlayerTurn = true; }