public void TransitionToState(FSMStateScrollView nextState) { if (nextState != remainState) { currentState.EndState(); currentState = nextState; nextState.StartState(); } }
public void InitState() { idleState = gameObject.AddComponent <IdleState>(); stateMoveToTarget = gameObject.AddComponent <UIMoveToTargetState>(); idleState.InitState(this); stateMoveToTarget.InitState(this); currentState = idleState; }