示例#1
0
 void SwitchToCurrentWeapon() // Conectar con el controller //Conectado por otro lado
 {
     Hands = ObjectInHands.fire;
     OnSwichHandWeapon(Hands);
     for (int i = 0; i < WeaponsInInventory.Count; i++)
     {
         WeaponsInInventory[i].gameObject.SetActive(false);
         WeaponsInInventory[i].isReloading = false;
         WeaponsInInventory[i].fireLock    = false;
     }
     //transform.Find(weapons[CurrenWeaponIndex].ToString()).gameObject.SetActive(true);
     WeaponbaseCurrent.OnSwich();
     try {
         WeaponsInInventory[CurrenWeaponIndex].gameObject.SetActive(true);
         WeaponbaseCurrent = WeaponsInInventory[CurrenWeaponIndex].gameObject.GetComponent <WeaponBase>();
     }
     catch { Debug.LogWarning("Un indice ha salido del rango, pero no afecta al sistema"); }
     WeaponbaseCurrent.AsingConfigurations();
     Switch = false;
 }