Exemplo n.º 1
0
 void DetectShootInput()
 {
     if (Input.GetKeyDown(KeyCode.Mouse0))
     {
         ShootInput?.Invoke();
     }
 }
Exemplo n.º 2
0
 void DetectShootInput()
 {
     //left click is pressed
     if (Input.GetKeyDown(KeyCode.Mouse0))
     {
         ShootInput?.Invoke();
     }
 }
Exemplo n.º 3
0
 private void CheckShootInput()
 {
     if (Input.GetKeyDown(gameSettings.shootKey))
     {
         ShootInput.Invoke(KeyInputType.Down);
     }
     else if (Input.GetKey(gameSettings.shootKey))
     {
         ShootInput.Invoke(KeyInputType.Held);
     }
     else if (Input.GetKeyUp(gameSettings.shootKey))
     {
         ShootInput.Invoke(KeyInputType.Up);
     }
 }
Exemplo n.º 4
0
        // Update is called once per frame
        public void OnShoot(InputValue value)
        {
            var shoot = new ShootInput {
            };

            inputBuffer.AddInput(CharSelector.SelectedCharacter, shoot);
            var button = new ButtonInput
            {
                is_press    = value.isPressed,
                is_release  = !value.isPressed,
                button_name = "Shoot",
                value       = value.Get <float>()
            };

            inputBuffer.AddInput(CharSelector.SelectedCharacter, button);
        }