/// <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);
        }
Exemple #2
0
 /// <summary>
 /// Called When the state is activated
 /// </summary>
 public void OnStateStart(IBehaviourStateUser user, BehaviourStateInfo info)
 {
     OnStateStart((T)user, info);
 }
Exemple #3
0
 /// <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));
 }
Exemple #4
0
 public void GlobalStateSwitching(IBehaviourStateUser user)
 {
     GlobalStateSwitching((T)user);
 }
Exemple #5
0
 public void DestroyStateSwitching(IBehaviourStateUser user)
 {
     DestroyStateSwitching((T)user);
 }
Exemple #6
0
 public void AwakeStateSwitching(IBehaviourStateUser user)
 {
     AwakeStateSwitching((T)user);
 }