예제 #1
0
        public void OnAddedToEntity()
        {
            _moveComponent = Entity.GetComponent <MoveComponent>();
            _jumpComponent = Entity.GetComponent <JumpComponent>();

            YetiGame.InputManager.RegisterInputEvent("MoveLeft", () => _moveComponent.SetMoveDirection(-1, 0), InputEventType.Held);
            YetiGame.InputManager.RegisterInputEvent("MoveRight", () => _moveComponent.SetMoveDirection(1, 0), InputEventType.Held);
            YetiGame.InputManager.RegisterInputEvent("MoveLeft", () => _moveComponent.SetMoveDirection(0, 0), InputEventType.Released);
            YetiGame.InputManager.RegisterInputEvent("MoveRight", () => _moveComponent.SetMoveDirection(0, 0), InputEventType.Released);
            YetiGame.InputManager.RegisterInputEvent("Jump", () => _jumpComponent.BeginJump());
        }
예제 #2
0
 public void OnAddedToEntity()
 {
     _moveComponent = Entity.GetComponent <MoveComponent>();
     _jumpComponent = Entity.GetComponent <JumpComponent>();
 }