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();
 }
Exemple #2
0
 void Start()
 {
     _controls = new GameControls();
     _controls.Enable();
     _controls.Keyboard.Interact.performed += context => { Interact(); };
     _controls.Keyboard.Throw.performed    += context => { PickupThrow(); };
 }
Exemple #3
0
        private void OnEnable()
        {
            ResetState();

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

        _controls.Default.Space.performed += HandleSpace;

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

            StartCoroutine(MoveCommandCoroutine());
        }
Exemple #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;
    }
Exemple #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();
        }
Exemple #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();
    }
Exemple #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();
        }
Exemple #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();
    }
    // 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;
    }
Exemple #12
0
 private void OnEnable()
 {
     gameInputController.Enable();
 }
 private void OnEnable()
 {
     inputActions.Enable();
 }
Exemple #14
0
 private void OnEnable()
 {
     input.Enable();
 }
 private void OnEnable()
 {
     _gameControls.Default.Move.performed += OnMovePerformed;
     _gameControls.Enable();
 }
Exemple #16
0
 public PlayerShootingController()
 {
     _playerControls = new GameControls();
     _playerControls.Enable();
     _bulletViewPrefab = Resources.Load <GameObject>(BulletViewPath);
 }
 public void OnEnable()
 {
     gameControls.Enable();
 }
Exemple #18
0
 private void OnEnable()
 {
     _gameControls.Enable();
 }
Exemple #19
0
 public PlayerMovementController()
 {
     _controls = new GameControls();
     _controls.Enable();
 }
Exemple #20
0
 private void OnEnable()
 {
     _controls.Enable();
 }
 private void OnEnable()
 {
     input.Enable();                                 // enables user input
 }
Exemple #22
0
 protected virtual void OnEnable()
 {
     gameControls.Enable();
 }