Ejemplo n.º 1
0
 public void SwitchWeapons(Animator animator)
 {
     if (Time.time >= switchTime + switchCooldown)
     {
         index++;
         index %= weapons.Count;
         currentWeapon.gameObject.SetActive(false);
         currentWeapon = weapons[index];
         currentWeapon.gameObject.SetActive(true);
         switchTime = Time.time;
         animator.runtimeAnimatorController = currentWeapon.GetAnimator();
         return;
     }
     return;
 }