Example #1
0
 void OnEnable()
 {
     //set this GameObject as a listener for the events coming from the Input System
     playerControls = new GameControls();
     playerControls.Gameplay.SetCallbacks(this);
     playerControls.Enable();
 }
Example #2
0
 void Start()
 {
     _controls = new GameControls();
     _controls.Enable();
     _controls.Keyboard.Interact.performed += context => { Interact(); };
     _controls.Keyboard.Throw.performed    += context => { PickupThrow(); };
 }
Example #3
0
        private void OnEnable()
        {
            ResetState();

            overlay.gameObject.SetActive(true);
            gameControls.Enable();
        }
Example #4
0
    private void Awake()
    {
        _controls = new GameControls();

        _controls.Default.Space.performed += HandleSpace;

        _controls.Enable();
    }
Example #5
0
        private void OnEnable()
        {
            _gameControls.Default.Move.performed    += OnMovePerformed;
            _gameControls.Default.Restart.performed += OnRestartPerformed;
            _gameControls.Default.Exit.performed    += OnExitPerformed;
            _gameControls.Enable();

            StartCoroutine(MoveCommandCoroutine());
        }
Example #6
0
    private void OnEnable()
    {
        GameControls = new GameControls();
        GameControls.Enable();

        GameControls.CityBuilding.Movement.performed += CameraMovementEvent.Invoke;
        GameControls.CityBuilding.Rotation.performed += CameraRotationEvent.Invoke;
        GameControls.CityBuilding.Zoom.performed     += CameraZoomEvent.Invoke;

        GameControls.CityBuilding.SelectionClick.performed += SelectionEvent.Invoke;
    }
Example #7
0
        public override void OnStartAuthority()
        {
            _cameraTransform.gameObject.SetActive(true);

            _controls = new GameControls();

            _controls.Player.CameraMove.performed += SetPreviousInput;
            _controls.Player.CameraMove.canceled  += SetPreviousInput;

            _controls.Enable();
        }
Example #8
0
    public void Awake()
    {
        GameControls inputController = new GameControls();

        inputController.GameControl.CursorLocation.performed += ctx =>
        {
            Vector2 mousePos = ctx.ReadValue <Vector2>();
            transform.position = new Vector3(mousePos.x, mousePos.y, -10);
        };

        inputController.Enable();
    }
Example #9
0
        private void Awake()
        {
            _movementController = GetComponent <MovementController>();
            _shootingController = GetComponent <ShootingController>();
            _transform          = GetComponent <Transform>();

            _controls = new GameControls();

            _controls.Default.Move.performed += HandleMove;
            _controls.Default.Move.canceled  += HandleMove;

            _controls.Default.Shoot.performed += HandleShoot;

            _controls.Enable();
        }
Example #10
0
    private void Start()
    {
        GiveItem(0);
        GiveItem("Titanium", 1999);
        GiveItem("Diamond", 100);

        InventoryPanel.SetActive(false);
        GameControls test = new GameControls();

        test.GameControl.SpawnStation.performed += _ =>
        {
            Debug.Log("Giving Item");
            GiveItem(0, 700);
        };
        test.GameControl.SpawnShip.performed += _ =>
        {
            Debug.Log("Giving Diamond");
            GiveItem(1, 800);
        };
        test.Enable();
    }
Example #11
0
    // Start is called before the first frame update
    void Start()
    {
        playerObject = GetComponent <PlayerObject>();
        playerObject.OnCharacterDeath += OnPlayerDied;

        gameControls = new GameControls();

        gameControls.Game.Select.performed  += OnSelect;
        gameControls.Game.Escape.performed  += OnEscape;
        gameControls.Game.Discard.performed += OnDiscard;
        gameControls.Game.North.performed   += OnNorth;
        gameControls.Game.South.performed   += OnSouth;
        gameControls.Game.East.performed    += OnEast;
        gameControls.Game.West.performed    += OnWest;
        gameControls.Game.EndTurn.performed += OnEndTurn;
        gameControls.Game.Reset.performed   += OnResetLevel;

        gameControls.Enable();

        LevelManager.Get().OnLevelStateChange += OnLevelStateChange;
    }
Example #12
0
 private void OnEnable()
 {
     gameInputController.Enable();
 }
 private void OnEnable()
 {
     inputActions.Enable();
 }
Example #14
0
 private void OnEnable()
 {
     input.Enable();
 }
Example #15
0
 private void OnEnable()
 {
     _gameControls.Default.Move.performed += OnMovePerformed;
     _gameControls.Enable();
 }
Example #16
0
 public PlayerShootingController()
 {
     _playerControls = new GameControls();
     _playerControls.Enable();
     _bulletViewPrefab = Resources.Load <GameObject>(BulletViewPath);
 }
 public void OnEnable()
 {
     gameControls.Enable();
 }
Example #18
0
 private void OnEnable()
 {
     _gameControls.Enable();
 }
Example #19
0
 public PlayerMovementController()
 {
     _controls = new GameControls();
     _controls.Enable();
 }
Example #20
0
 private void OnEnable()
 {
     _controls.Enable();
 }
 private void OnEnable()
 {
     input.Enable();                                 // enables user input
 }
Example #22
0
 protected virtual void OnEnable()
 {
     gameControls.Enable();
 }