Ejemplo n.º 1
0
    protected override void OnStartRunning()
    {
        base.OnStartRunning();

        // Enable when the system is enabled
        inputMaster.Enable();
    }
Ejemplo n.º 2
0
 private void OnEnable()
 {
     // enable controls and link to appropriate functions
     c.Enable();
     c.Player.Move.performed += ctx => StartMoving(ctx.ReadValue <Vector2>());
     c.Player.Move.canceled  += ctx => StopMoving(ctx.ReadValue <Vector2>());
 }
Ejemplo n.º 3
0
 private void onEnable()
 {
     controls = new InputMaster();
     controls.Enable();
     //controls.Player.RightClick.performed += ctx => SnapObjectToRightHand();
     //controls.Player.LeftClick.performed += ctx => SnapObjectToLeftHand();
 }
Ejemplo n.º 4
0
        protected override void SystemEnabled()
        {
            base.SystemEnabled();

            inputMaster.Enable();
            inputMaster.PlayerActions.AttackAction.performed += OnAttackPerformed;
        }
Ejemplo n.º 5
0
 private void OnEnable()
 {
     controls.Enable();
     controls.Player.Interact.performed += InteractButtonPressed;
     controls.Player.Attack.performed   += AttackButtonPressed;
     controls.Player.Jump.performed     += DodgeButtonPressed;
 }
Ejemplo n.º 6
0
    private void Awake()
    {
        input = new InputMaster();
        input.Enable();

        allowRestart = false;
    }
Ejemplo n.º 7
0
    private void Awake()
    {
        player = GameObject.FindGameObjectWithTag("System").GetComponent <AudioPlayer>();

        input = new InputMaster();
        input.Enable();

        // bind handlers
        if (controllerID == 0)
        {
            connected     = true;
            input.devices = new[] { InputDevice.all[0] };
            input.Home.ChangeSelection.performed += context => SwitchSelectedButton(context);
            input.Home.Select.performed          += context => Enter(context);
        }
        else
        {
            if (Gamepad.all.Count >= controllerID)
            {
                connected     = true;
                input.devices = new[] { Gamepad.all[controllerID - 1] };
                input.Home.ChangeSelection.performed += context => SwitchSelectedButton(context);
                input.Home.Select.performed          += context => Enter(context);
            }
            else
            {
                connected = false;
            }
        }
    }
Ejemplo n.º 8
0
 public void OnEnable()
 {
     if (!photonView.IsMine && PhotonNetwork.IsConnected == true)
     {
         return;
     }
     inputMaster.Enable();
 }
Ejemplo n.º 9
0
 private void OnEnable()
 {
     inputMaster.Enable();
     inputMaster.Player.Enable();
     inputMaster.EquipmentGUI.Disable();
     inputMaster.PickupGUI.Disable();
     inputMaster.UseWeaponGUI.Disable();
 }
Ejemplo n.º 10
0
 private void OnEnable()
 {
     if (controls == null)
     {
         controls = new InputMaster();
     }
     controls.Enable();
 }
Ejemplo n.º 11
0
 private void Awake()
 {
     _inputMaster = new InputMaster();
     _inputMaster.Enable();
     _playerRb    = GetComponent <Rigidbody2D>();
     _gameStarted = false;
     _facingRight = true;
 }
Ejemplo n.º 12
0
    private void Start()
    {
        input.Enable();
        background.texture = teams.group[teamIndex].teamBackground;

        UpdateCharacter();
        progress = 0.0f;
    }
 private void Awake()
 {
     Cursor.lockState = CursorLockMode.Locked;
     Cursor.visible   = false;
     InputMaster.Enable();
     gameManager = GameManager.Instance;
     EmergencyListener.enabled = false;
 }
Ejemplo n.º 14
0
 private void Awake()
 {
     head     = GetComponentInChildren <Camera>().transform;
     controls = new InputMaster();
     controls.Enable();
     controls.Player3DFP.Movement.performed += context => Move(context.ReadValue <Vector2>());
     controls.Player3DFP.Rotation.performed += context => Rotate(context.ReadValue <Vector2>());
 }
Ejemplo n.º 15
0
 private void OnEnable()
 {
     controls.CameraRig.Pan.performed             += OnPan;
     controls.CameraRig.Zoom.performed            += OnZoom;
     controls.CameraRig.Rotate.performed          += OnRotate;
     controls.CameraRig.DragIndicator.performed   += OnDragIndicator;
     controls.CameraRig.RotateIndicator.performed += OnRotateIndicator;
     controls.Enable();
 }
Ejemplo n.º 16
0
    private void OnEnable()
    {
        controls = new InputMaster();

        controls.Enable();

        controls.Player.Use.performed     += OnUseStartPerformed;
        controls.Player.UseHold.performed += OnUsePerformed;
    }
Ejemplo n.º 17
0
    void Awake()
    {
        rb       = GetComponent <Rigidbody2D>();
        collider = GetComponent <Collider2D>();
        animator = GetComponent <Animator>();

        inputActions = new InputMaster();
        inputActions.Enable();
        inputActions.Player.Move.performed += ctx => movementInput = ctx.ReadValue <Vector2>();
    }
Ejemplo n.º 18
0
    // Initialize variables
    private void Awake()
    {
        inputs = new InputMaster();
        inputs.Text.Advance.performed += ctx => ContinueStory();
        inputs.Enable();

        talkingSound.audioSource        = gameObject.AddComponent <AudioSource>();
        talkingSound.audioSource.clip   = talkingSound.audioClip;
        talkingSound.audioSource.volume = talkingSound.volume;
    }
    // Use Awake for initialization (setting up components etc.)
    private void Awake()
    {
        input = new InputMaster();
        input.Enable();
        // subscribe functions to input events
        input.Exploration.Move.performed += ctx => moveAxis = ctx.ReadValue <Vector2>();        // lambda function for copying Move value to moveAxis
        input.Exploration.Move.canceled  += ctx => moveAxis = Vector2.zero;

        input.Exploration.Interact.performed += ctx => Interact();
    }
Ejemplo n.º 20
0
        private void Awake()
        {
            Input = new InputMaster();
            Input.Enable();

            CurrentShip = GetComponent <IShip>();

            MainCamera   = Camera.main;
            CameraOffset = transform.position.z - MainCamera.transform.position.z;
        }
Ejemplo n.º 21
0
 public void SetControlsActive(bool value)
 {
     if (value)
     {
         controls.Enable();
     }
     else
     {
         controls.Disable();
     }
 }
Ejemplo n.º 22
0
        public void Awake()
        {
            Instance    = this;
            _behaviours = GetComponents <IPlacementBehaviour>();

            InputMaster master = new InputMaster();

            master.General.CancelPause.performed += Cancel;
            master.General.Enable();
            master.Enable();
        }
 public void SetLockState(bool unlocked)
 {
     if (unlocked)
     {
         input.Enable();
     }
     else
     {
         input.Disable();
     }
 }
    #pragma warning restore 649

    #region Inputs and Buttons Set-Up

    // Initialize variables
    private void Awake()
    {
        inputs = new InputMaster();
        inputs.InGame.AdvanceDialog.performed += ctx => ContinueStory();
        inputs.InGame.FastForward.started     += ctx => fastForwardCoroutine = StartCoroutine(FastForwardingHold());
        inputs.InGame.FastForward.canceled    += ctx => StopCoroutine(fastForwardCoroutine);
        inputs.InGame.FastForward.canceled    += ctx => fastForwarding = false;
        inputs.Enable();

        buttons = GetComponentInChildren <ButtonAnimator>().buttons;
    }
Ejemplo n.º 25
0
        void OnEnable()
        {
            // Enable camera controls when camera is enabled
            controls.Enable();

            // Subscribes
            controls.Camera.Aim.started  += Aim_performed;
            controls.Camera.Aim.canceled += Aim_canceled;

            m_TargetCameraState.SetFromTransform(transform);
            m_InterpolatingCameraState.SetFromTransform(transform);
        }
Ejemplo n.º 26
0
    private void OnEnable()
    {
        if (inputMaster == null)
        {
            inputMaster = new InputMaster();
        }

        // Inicializace controllérů & (přídání do listu controllers)
        InitalizeControllers();

        inputMaster.Enable();
    }
Ejemplo n.º 27
0
 void Awake()
 {
     input = new InputMaster();
     input.Enable();
     input.Tank.Movement.performed     += context => Move(context.ReadValue <float>());
     input.Tank.Movement.canceled      += context => Move(context.ReadValue <float>());              //sends value of 0 as button is released
     input.Tank.ChangeWeapon.performed += context => ChangeWeapon((int)context.ReadValue <float>()); //even though type is float possible values can be only 1*scale(weapon index)
     input.Tank.Rotation.performed     += context => Rotate(context.ReadValue <float>());
     input.Tank.Rotation.canceled      += context => Rotate(context.ReadValue <float>());
     input.Tank.Fire.performed         += context => Fire(context.ReadValue <float>());
     input.Tank.Fire.canceled          += context => Fire(context.ReadValue <float>());
 }
Ejemplo n.º 28
0
    private IEnumerator LoseCoroutine()
    {
        loseText.SetActive(true);
        controls.Disable();
        StopCoroutine(timeCoroutine);

        yield return(new WaitForSeconds(3f));

        currentTime = 0;
        controls.Enable();
        loseText.SetActive(false);
        StartGame();
    }
Ejemplo n.º 29
0
        public static void Init()
        {
            Master = new InputMaster();

            PrimaryClick   = Master.General.PrimaryClick;
            SecondaryClick = Master.General.SecondaryClick;

            Master.General.CancelPause.started    += OnCancelPauseStarted;
            Master.General.PrimaryClick.started   += OnPrimaryClickStarted;
            Master.General.SecondaryClick.started += OnSecondaryClickStarted;

            EnableAllMaster();
            Master.Enable();
        }
Ejemplo n.º 30
0
    private void Awake()
    {
        player = GameObject.FindGameObjectWithTag("System").GetComponent <AudioPlayer>();

        input = new InputMaster();
        input.Enable();

        ControllerManager manager = ControllerManager.Instance;

        if (manager.type == ControllerManager.Type.STANDARD)
        {
            controllerOffset = 1;
        }
        else if (manager.type == ControllerManager.Type.SPLIT_KEYBOARD)
        {
            controllerOffset = 2;
        }
        else if (manager.type == ControllerManager.Type.ALL_CONTROLLER)
        {
            controllerOffset = 0;
        }

        if (controllerID < controllerOffset)
        {
            connected     = true;
            input.devices = new[] { InputDevice.all[0] };
            Bind();
        }
        else
        {
            if (Gamepad.all.Count > controllerID + controllerOffset)
            {
                connected     = true;
                input.devices = new[] { Gamepad.all[controllerID - controllerOffset] };
                Bind();
            }
            else
            {
                connected = false;
            }
        }

        // bind

        background = GetComponent <RawImage>();
        label      = GetComponentInChildren <Text>();

        isHolding = false;
        played    = false;
    }