public void Take() { switch (Item_name) { case "MachinegunAmmo": weapon_behave.CurrentMagazine += Value; weapon_behave.CurrentMagazine = Mathf.Clamp(weapon_behave.CurrentMagazine, 0, weapon_behave.MaxMagazine); weapon_behave.CantReload = false; Destroy(this.gameObject); return; case "PistolAmmo": weapon_behave.CurrentMagazine += Value; weapon_behave.CurrentMagazine = Mathf.Clamp(weapon_behave.CurrentMagazine, 0, weapon_behave.MaxMagazine); weapon_behave.CantReload = false; Destroy(this.gameObject); return; case "Ak47Ammo": weapon_behave.CurrentMagazine += Value; weapon_behave.CurrentMagazine = Mathf.Clamp(weapon_behave.CurrentMagazine, 0, weapon_behave.MaxMagazine); weapon_behave.CantReload = false; Destroy(this.gameObject); return; case "ShotGunAmmo": weapon_behave.CurrentMagazine += Value; weapon_behave.CurrentMagazine = Mathf.Clamp(weapon_behave.CurrentMagazine, 0, weapon_behave.MaxMagazine); weapon_behave.CantReload = false; Destroy(this.gameObject); return; case "Health": player_Vida.QuitarVida(-Value); Destroy(this.gameObject); return; } }
void AnimEventDañarAlJugador(int daño) { vidaJugador.QuitarVida(daño); }