// 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> ();
 }
Beispiel #2
0
    void playerAmmo()
    {
        ammo = carbine.getAmmo();
        string reload = "\n        ";

        if (ammo.currentMag <= 5)
        {
            reload = "\n[R]eload";
        }
        playerAmmoText.guiText.text = ammo.currentMag + " / " + ammo.reserve + reload;
    }
Beispiel #3
0
    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();
 }
Beispiel #7
0
 public void setAmmo(Amunition munition)
 {
     ammo = munition;
 }