예제 #1
0
    public void AddWeapon(ScriptableGun weapon)
    {
        if (currentlyEquipped == weapon)
        {
            AddAmmo(25);
        }
        else
        {
            currentlyEquipped = weapon;

            if (ammo.ContainsKey(currentlyEquipped.ammoID) == false)
            {
                ammo.Add(currentlyEquipped.ammoID, 50);
            }
            else
            {
                AddAmmo(25);
            }

            SpawnGun();
        }
        //TODO Check to see if its already equipped
        //If it is, then we just need to add ammo

        //TODO If not already equipped, spawn new gun

        UpdateUI();
    }
예제 #2
0
    private void attachNewGuns(ScriptableGun scrGun, int type = 0)
    {
        switch (type)
        {
        case 0:
            holsters[holsterToReplace].GetComponent <GunController>().gun = scrGun;
            holsterToReplace = (holsterToReplace + 1) % holsters.Length;
            break;

        default: break;
        }
    }
예제 #3
0
 public void Init(string tag, ScriptableGun gun)
 {
     base.Init(tag);
     weapon = gun;
 }