void Update()
 {
     if (Input.GetButtonDown(InputMapping.GetInputName(playerTag, InputMapping.Input.B)) && trapCount > 0)
     {
         --trapCount;
         PlaceTrap();
     }
 }
 void Update()
 {
     if (_time > 0.0f)
     {
         _time -= Time.deltaTime;
     }
     else if (Input.GetAxisRaw(InputMapping.GetInputName(playerTag, InputMapping.Input.RT)) > 0.5)
     {
         _time = cooldown;
         Shoot();
     }
 }
Esempio n. 3
0
    void Update()
    {
        Debug.DrawLine(transform.position, transform.position + transform.rotation * Vector3.forward * 3, Color.red);

        _moveInput = new Vector3(Input.GetAxisRaw(InputMapping.GetInputName(playerTag, InputMapping.Input.Horizontal)), 0f,
                                 Input.GetAxisRaw(InputMapping.GetInputName(playerTag, InputMapping.Input.Vertical)));
        _moveVelocity = _moveInput * speed;

        Vector3 newDirection = Vector3.right * Input.GetAxisRaw(InputMapping.GetInputName(playerTag, InputMapping.Input.RHorizontal))
                               + Vector3.forward * Input.GetAxisRaw(InputMapping.GetInputName(playerTag, InputMapping.Input.RVertical));

        if (newDirection.sqrMagnitude > 0.0f)
        {
            transform.rotation = Quaternion.LookRotation(newDirection, Vector3.up);
        }
    }