private void Awake() { if (Instance == null) { Instance = this; } }
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); }