private void onJelloportationStarted(Signal signal) { JelloportationStartedSignal jelloportationStartedSignal = (JelloportationStartedSignal)signal; JelloPlate destination = thisJelloporter.ChooseDestination(jelloportationStartedSignal.newJelloState); if (destination == thisJelloporter.TopPlate) { nextState = new JumpToTopPlate(thisJelloporter); } else { nextState = new JumpToBottomPlate(thisJelloporter); } }
private void Update() { if (currentState == null) { currentState = new JelloIdleState(this); currentState.Start(); } JelloporterState nextState = currentState.Update(); if (nextState != currentState) { currentState.End(); currentState = nextState; currentState.Start(); } }
private void onJelloportationFinished(Signal signal) { nextState = new JelloIdleState(thisJelloporter); }
public JumpToBottomPlate(Jelloporter thisJelloporter) : base(thisJelloporter) { nextState = this; }
public JelloIdleState(Jelloporter thisJelloporter) : base(thisJelloporter) { this.nextState = this; }