RemoveState() public method

public RemoveState ( States state ) : void
state States
return void
Exemplo n.º 1
0
 public static void RemoveState( CharacterStateMachine stateMachine, States state )
 {
     stateMachine.RemoveState(state);
 }
            public StateStruct( States state, Action onEnterFunction, Action onUpdateFunction, Action onExitFunction, float time, CharacterStateMachine stateMachine )
            {
                this.state = state;
                this.onEnterFunction = onEnterFunction;
                this.onUpdateFunction = onUpdateFunction;
                this.onExitFunction = onExitFunction;
                this.time = time;

                this.timer = new Timer(time, stateMachine, state);
                if(onEnterFunction != null)
                    timer.timerStarted += onEnterFunction;
                if(onUpdateFunction != null)
                    timer.timerUpdate += onUpdateFunction;
                if(onExitFunction != null)
                    timer.timerCompleted += onExitFunction;
                timer.timerCompleted += () => stateMachine.RemoveState(state);
            }