public virtual void ChangeState(BaseBehaviorStates newState) { if (newState != State) { State = newState; MyBehaviorManager.BehaviorChangedState(newState); } }
protected override void HandleOnBehaviorStateChangedEvent(EntityComponent entity, BaseBehaviorStates newState) { //If we're performing actions at this point in time then mark that down so we don't change our Current Waypoint //And then let's stop moving! if (newState == BaseBehaviorStates.PerformingActions) { performingActions = true; StopMovement(); } else if (newState == BaseBehaviorStates.Moving) //If we're moving then we have to find out if we need to grab a new target or not... { if (CurrTarget == null && CurrWaypoint != null) //We have no target, set our waypoint to our target { CurrTarget = CurrWaypoint.transform; } ResumeMovement(); ForceRepath(); performingActions = false; } base.HandleOnBehaviorStateChangedEvent (entity, newState); }
public void BehaviorChangedState(BaseBehaviorStates newState) { Debug.Log(string.Format("{0} Changed State to: {1}", myEntityComponent, newState)); if (OnBehaviorStateChangedEvent != null) OnBehaviorStateChangedEvent(myEntityComponent, newState); }
protected virtual void HandleOnBehaviorStateChangedEvent(EntityComponent entity, BaseBehaviorStates newState) { if (newState == BaseBehaviorStates.Dying) canMove = false; }
void HandleOnBehaviorStateChangedEvent(EntityComponent entity, BaseBehaviorStates newState) { if (newState == BaseBehaviorStates.PerformingActions) { PerformingActions = true; } else { StopActions(); } }