Exemple #1
0
 private void Update()
 {
     //Si su velocidad es 0, entonces tiene que poner la anim de Idel
     if (Mathf.Abs(_rb.velocity.x) <= 0.9f && Mathf.Abs(_rb.velocity.z) <= 0.9f)
     {
         _idle.Idle();
         _view.Idle();
     }
 }
Exemple #2
0
 // Update is called once per frame
 void Update()
 {
     if (isLocalPlayer)
     {
         if (Input.GetKey(KeyCode.W) || Input.GetKey(KeyCode.A) || Input.GetKey(KeyCode.S) || Input.GetKey(KeyCode.D))
         {
             WalkComponent.Walk();
         }
         if (Input.GetKey(KeyCode.Space))
         {
             JumpComponent.Jump();
         }
         if (!Input.anyKeyDown && !Input.anyKey)
         {
             IdleComponent.Idle();
         }
         if (Input.GetMouseButtonDown(1))
         {
             WeaponComponents[SelectedWeapon].UseWeaponPrimary();
         }
         if (Input.GetMouseButtonDown(2))
         {
             WeaponComponents[SelectedWeapon].UseWeaponSecondary();
         }
         if (Input.GetKey(KeyCode.V))
         {
             //Quick Meele
         }
         if (Input.GetKey(KeyCode.Q))
         {
             //Ultimate
         }
         if (Input.GetKey(KeyCode.E))
         {
             //PrimaryAbility
         }
         if (Input.GetKey(KeyCode.LeftShift))
         {
             //UtilityAbility
         }
         if (Input.GetKey(KeyCode.R))
         {
             //Reload
         }
     }
 }