/// <summary> /// The User is the object which will be effected by the states. /// The Switcher is the class which decides which state will be set when. /// </summary> public BehaviourStateHandler(IBehaviourStateUser user) { User = user; this.switcher = Activator.CreateInstance <S>(); object context = new object(); Confactory.ConfactoryFinder.Instance.Get <ConCoroutines>().StartCoroutine(SwitcherAwakeCall(context), context); }
/// <summary> /// Called When the state is activated /// </summary> public void OnStateStart(IBehaviourStateUser user, BehaviourStateInfo info) { OnStateStart((T)user, info); }
/// <summary> /// This will be called before activated. If this returns false the user will stay in his current state /// </summary> public bool IsAbleToActivate(IBehaviourStateUser user) { return(IsAbleToActivate((T)user)); }
public void GlobalStateSwitching(IBehaviourStateUser user) { GlobalStateSwitching((T)user); }
public void DestroyStateSwitching(IBehaviourStateUser user) { DestroyStateSwitching((T)user); }
public void AwakeStateSwitching(IBehaviourStateUser user) { AwakeStateSwitching((T)user); }