Beispiel #1
0
        private void Awake()
        {
            _controls = new InputControls();
            _controls.Move.SetCallbacks(this);

            _controls.Enable();
        }
        private void OnEnable()
        {
            CheckpointZone.checkpointChangeEvent += ChangeCheckpoint;

            InputControls inputControls = new InputControls();

            inputControls.Enable();
        }
Beispiel #3
0
    private void OnEnable()
    {
        inputControls.Player.Move.performed += ctx => inputVal = ctx.ReadValue <Vector2>();
        inputControls.Player.Move.canceled  += ctx => inputVal = Vector3.zero;

        inputControls.Player.Jump.performed += ctx => isMovingUpPressed = true;
        inputControls.Player.Jump.canceled  += ctx => isMovingUpPressed = false;

        inputControls.Player.Crouch.performed += ctx => isMovingDownPressed = true;
        inputControls.Player.Crouch.canceled  += ctx => isMovingDownPressed = false;

        inputControls.Player.Fire.performed += ctx => Fire();

        inputControls.Player.Scan.performed += ctx => Scan();
        inputControls.Player.Scan.canceled  += ctx => ScanRelease();

        inputControls.Enable();
    }
Beispiel #4
0
 // Start is called before the first frame update
 private void OnEnable()
 {
     audioSource = GetComponent <AudioSource>();
     audioSource.Play();
     if (allowNextLevel)
     {
         inputAction.Enable();
     }
 }
Beispiel #5
0
    private void OnEnable()
    {
        inputActions.Enable();

        myBrain.enabled = true;

        cinemachineTrackedDolly = mainCamera.GetCinemachineComponent <CinemachineTrackedDolly>();
        pathLength   = cinemachineTrackedDolly.m_Path.MaxPos;
        pathPosition = cinemachineTrackedDolly.m_PathPosition;
    }
Beispiel #6
0
    private void Awake()
    {
        Instance = this;

        InputControls = new InputControls();

        InputControls.Enable();

        ToggleCursor();
    }
        private void OnEnable()
        {
            PlaymodeManager.changeCameraTarget += SetCameraTarget;

            InputControls inputControls = new InputControls();

            inputControls.Camera.Rotate.performed += context => Rotate(context.ReadValue <Vector2>());

            inputControls.Enable();
        }
    void Start()
    {
        input = new InputControls();
        input.Enable();

        input.Gameplay.HitStraight.started  += ctrl => ButtonDown?.Invoke(Buttons.HitStraight);
        input.Gameplay.HitStraight.canceled += ctrl => ButtonUp?.Invoke(Buttons.HitStraight);

        input.Gameplay.HitLob.started  += ctrl => ButtonDown?.Invoke(Buttons.HitLob);
        input.Gameplay.HitLob.canceled += ctrl => ButtonUp?.Invoke(Buttons.HitLob);
    }
        private void OnEnable()
        {
            InputControls inputControls = new InputControls();

            inputControls.Character.Interact.performed += context => Interact();
            inputControls.Vehicle.Interact.performed   += context => Interact();

            inputControls.Enable();

            VehicleEntryPoint.damageDealtEvent += SetVehicleEnterable;
        }
Beispiel #10
0
 public void ToggleInput(bool toggle)
 {
     if (toggle)
     {
         input.Enable();
     }
     else
     {
         input.Disable();
     }
 }
Beispiel #11
0
    private void OnEnable()
    {
        GlobalVolumeController.PlayVisualFX.FadeIn();

        currentMenu = mainMenu;
        inputControls.UI.Back.performed += ctx => Back();
        inputControls.Enable();

        mainMenuRect
        .DOLocalMoveY(middleScreen, moveDuration)
        .SetEase(Ease.OutBack)
        .SetUpdate(true);
    }
Beispiel #12
0
    private void OnEnable()
    {
        Cursor.lockState = CursorLockMode.Confined;
        Cursor.visible   = true;

        currentMenu = basePauseMenu;

        inputControls.UI.Back.performed += ctx => Back();
        inputControls.Enable();

        basePauseMenuRect
        .DOLocalMoveY(middleScreen, moveDuration)
        .SetEase(Ease.OutBack)
        .SetUpdate(true);
    }
Beispiel #13
0
 public virtual void willOnFocus()
 {
     foreach (var item in GetComponentsInChildren <ButtonController>())
     {
         if (item.active)
         {
             item.gameObject.GetComponent <UnityEngine.UI.Button>().interactable = true;
         }
     }
     fingerActive = true;
     inputs.Enable();
     if (needsResetLastSelectedGameObject && currentSelectedGameObjectWhenLostFocus != null)
     {
         EventSystem.current.SetSelectedGameObject(currentSelectedGameObjectWhenLostFocus);
         currentSelectedGameObjectWhenLostFocus = null;
     }
 }
        /// <summary>
        /// Start is called before the first frame update
        /// </summary>
        private void Start()
        {
            // Retrieve all the input recievers on start
            // NOTE: This could become rather performance intensive if not kept under check
            moveInputRecievers   = GetComponents <IMoveInputReciever>();
            actionInputRecievers = GetComponents <IActionInputReciever>();

            // Generate the input system
            inputControls = new InputControls();
            inputControls.Enable();

            // We add both to performed and canceled to ensure we recieve the released input.
            inputControls.WorldActions.Movement.performed += HandleMovement;
            inputControls.WorldActions.Movement.canceled  += HandleMovement;

            // Setup the accept button control
            inputControls.WorldActions.Accept.performed += Accept_performed;

            // Setup quit button control
            inputControls.WorldActions.Quit.performed += _ => onQuitPressed.Invoke();

            // Enable the input system
            SetPlayerControlEnabled(true);
        }
Beispiel #15
0
        /// <summary>
        /// Start is called before the first frame update
        /// </summary>
        private void Start()
        {
            // Generate the input system
            inputControls = new InputControls();
            inputControls.Enable();

            // Setup the move and look controls
            // We add both to performed and canceled to ensure we recieve the released input.
            inputControls.InWorld.Move.performed += HandleMovement;
            inputControls.InWorld.Move.canceled  += HandleMovement;

            inputControls.InWorld.Look.performed += HandleLook;
            inputControls.InWorld.Look.canceled  += HandleLook;

            // Setup the action button controls
            inputControls.InWorld.Fire1.performed += Fire1_performed;
            inputControls.InWorld.Fire1.canceled  += Fire1_canceled;

            inputControls.InWorld.Fire2.performed += Fire2_performed;
            inputControls.InWorld.Fire2.canceled  += Fire2_canceled;

            // Enable the input system
            SetPlayerControlEnabled(true);
        }
 private void OnEnable()
 {
     _controls.Enable();
     _controls.Player.Move.performed += MoveHandler;
 }
Beispiel #17
0
 private void OnEnable()
 {
     _controls.Enable();
 }
Beispiel #18
0
 public void willOnFocus()
 {
     inputs.Enable();
 }
Beispiel #19
0
 public InputHandler()
 {
     inputs = new InputControls();
     inputs.Enable();
 }
        // Enables the controls when the player is active
        private void OnEnable()
        {
            controls.Enable();

            puzzleModeUI.SetActive(true);
        }
Beispiel #21
0
        void IEcsInitSystem.Init()
        {
            _inputControls = new InputControls();
            _inputControls.Enable();

            // Common
            _inputControls.Common.PauseQuit.performed += context => _world.SendMessage(new InputPauseQuitEvent());
            _inputControls.Common.AnyKey.performed    += context => _world.SendMessage(new InputAnyKeyEvent());

            // Move
            _inputControls.Player1.Move.started += context =>
                                                   SendMessageInGame(new InputMoveStartedEvent()
            {
                PlayerNumber = 1, Axis = context.ReadValue <float>()
            });

            _inputControls.Player2.Move.started += context =>
                                                   SendMessageInGame(new InputMoveStartedEvent()
            {
                PlayerNumber = 2, Axis = context.ReadValue <float>()
            });

            _inputControls.Player1.Move.canceled += context =>
                                                    SendMessageInGame(new InputMoveCanceledEvent()
            {
                PlayerNumber = 1
            });

            _inputControls.Player2.Move.canceled += context =>
                                                    SendMessageInGame(new InputMoveCanceledEvent()
            {
                PlayerNumber = 2
            });

            // Shoot
            _inputControls.Player1.Shoot.started += context =>
                                                    SendMessageInGame(new InputShootStartedEvent()
            {
                PlayerNumber = 1
            });

            _inputControls.Player2.Shoot.started += context =>
                                                    SendMessageInGame(new InputShootStartedEvent()
            {
                PlayerNumber = 2
            });

            _inputControls.Player1.Shoot.canceled += context =>
                                                     SendMessageInGame(new InputShootCanceledEvent()
            {
                PlayerNumber = 1
            });

            _inputControls.Player2.Shoot.canceled += context =>
                                                     SendMessageInGame(new InputShootCanceledEvent()
            {
                PlayerNumber = 2
            });

            // Reload
            _inputControls.Player1.Reload.performed += context =>
                                                       SendMessageInGame(new InputReloadGunEvent()
            {
                PlayerNumber = 1
            });

            _inputControls.Player2.Reload.performed += context =>
                                                       SendMessageInGame(new InputReloadGunEvent()
            {
                PlayerNumber = 2
            });
        }
 private void OnEnable()
 {
     inputControls.Enable();
 }
Beispiel #23
0
 void OnEnable()
 {
     ctrl.Enable();
 }
Beispiel #24
0
 private void OnEnable()
 {
     input.InGame.Pause.performed += ctx => DeterminePauseState();
     input.Enable();
 }
Beispiel #25
0
 private void OnEnable()
 {
     inputAction.Enable();
 }