Example #1
0
 private void Awake()
 {
     if (Instance == null)
     {
         Instance = this;
     }
 }
Example #2
0
 public static void Main(string[] args)
 {
     var eventLoop = new EventLoop();
     var moveCursor = new MoveCursor();
     eventLoop.LeftHandler += moveCursor.Left;
     eventLoop.RightHandler += moveCursor.Right;
     eventLoop.UpHandler += moveCursor.Up;
     eventLoop.DownHandler += moveCursor.Down;
     eventLoop.Run();
 }
 protected virtual void OnMoveCursor(Direction direction, int amount)
 {
     MoveCursor?.Invoke(direction, amount);
 }