/// <summary> /// Returns a State of type <typeparamref name="Tstate"/> attached to the StateMachine, it adds it to the StateMachine if not found /// </summary> /// <typeparam name="Tstate">Type of the state</typeparam> /// <returns>The State of type <typeparamref name="Tstate"/> attached to the machine</returns> public virtual Tstate GetState <Tstate>() where Tstate : State { if (!IsValidStateType(typeof(Tstate))) { return(null); } Tstate target = GetComponent <Tstate>(); if (target == null) { target = gameObject.AddComponent <Tstate>(); } return(target); }
public MoveOperation(Tstate nextState, bool immediately) { NextState = nextState; Immediately = immediately; }
public State(Tstate state, Func <Socket, IOMultiPlex, MoveOperation> handler) { this.MatchState = state; this.Handler = handler; }