// Use this for initialization void OnEnable() { cgl = GameObject.FindGameObjectWithTag("GameController").GetComponent <CoreGameLoop>(); ammo = new Amunition(450, 30); props = new M4A1WeaponProperties(); rof = this.getRof(); gunSmoke.Stop(); melee = meleeGo.GetComponent <MeleeController> (); }
void playerAmmo() { ammo = carbine.getAmmo(); string reload = "\n "; if (ammo.currentMag <= 5) { reload = "\n[R]eload"; } playerAmmoText.guiText.text = ammo.currentMag + " / " + ammo.reserve + reload; }
public override void action(Collider col) { RefToPlayer playerRef = col.gameObject.GetComponent <RefToPlayer> (); if (playerRef != null) { M4A1Controller wb = playerRef.player.GetComponentInChildren <M4A1Controller> (); if (wb != null) { Amunition ammo = wb.getAmmo(); ammo.reserve += amount; wb.setAmmo(ammo); } } }
private void RemoveAmmo(Ammo item) { Amunition.Remove(item); }
private void AddAmmo(Ammo item) { Amunition.Add(item); }
void Awake() { ammo = new Amunition(120, 120); props = new AK47WeaponProperties(); rof = getRof(); }
public void setAmmo(Amunition munition) { ammo = munition; }