コード例 #1
0
 public void TransitionToState(FSMStateScrollView nextState)
 {
     if (nextState != remainState)
     {
         currentState.EndState();
         currentState = nextState;
         nextState.StartState();
     }
 }
コード例 #2
0
    public void InitState()
    {
        idleState         = gameObject.AddComponent <IdleState>();
        stateMoveToTarget = gameObject.AddComponent <UIMoveToTargetState>();

        idleState.InitState(this);
        stateMoveToTarget.InitState(this);

        currentState = idleState;
    }