public GreenScreenRoomInputStateMachine() { mGreenScreenRoomDefaultMovementState = new GreenScreenRoomDefaultMovementState(); mGreenScreenRoomNoMovementState = new GreenScreenRoomNoMovementState(); mInactiveState = new InactiveState(); mGreenScreenRoomDefaultMovementState.AddTransition(mGreenScreenRoomNoMovementState); mGreenScreenRoomDefaultMovementState.AddTransition(mInactiveState); mGreenScreenRoomNoMovementState.AddTransition(mGreenScreenRoomDefaultMovementState); mGreenScreenRoomNoMovementState.AddTransition(mInactiveState); mInactiveState.AddTransition(mGreenScreenRoomDefaultMovementState); mInactiveState.AddTransition(mGreenScreenRoomNoMovementState); this.EnterInitialState(mInactiveState); }
void Start() { var inactive = new InactiveState <Feed>(redLight); active = new ActiveState <Feed>(this, redLight); var explode = new ExplodeState <Feed>(explosionParticleSys, this); inactive.AddTransition(Feed.EnemigoEntraEnLOS, active); active.AddTransition(Feed.EnemigoSaleDeLOS, inactive); active.AddTransition(Feed.BOOOOM, explode); stateMachine = new FSM <Feed>(inactive); los = GetComponent <LOS>(); }