// Update is called once per frame void Update() { if (!ea.alive) { changeState(STATE_DEAD); } else if (ea.CanTargetPlayer()) { changeState(STATE_IDLE); } else { changeState(STATE_WALK); } }