public void ChangeState(int state) { //If we're already in this state, do not switch states again if (IsState(state)) { return; } myPlayerState = (PlayerState)state; switch (state) { case 0: OnIdleState?.Invoke(); break; case 1: OnRunState?.Invoke(); break; case 2: OnJumpState?.Invoke(); break; case 3: OnMeleeState?.Invoke(); break; case 4: OnLedgeGrabState?.Invoke(); break; case 5: OnStunState?.Invoke(); break; default: Debug.LogError("State does not exist!"); break; } }
public void RaiseIdleState(SocketContext <TMessage> context, IdleStateEvent eventState) { OnIdleState?.Invoke(this, new IdleStateEventArgs <TMessage>(context)); }