Advertisement
LeeMace

State Machine

May 2nd, 2024
277
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.24 KB | Gaming | 0 0
  1. //change CharacterBehaviour to inherit from StateMachine
  2. public class StateMachine : BaseBehaviour
  3. {
  4.     protected State state;
  5.  
  6.     public void SetState(State state) {
  7.         this.state = state;
  8.         this.state.Enter();
  9.     }
  10. }
  11.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement