Example #1
0
 // Start is called before the first frame update
 void Start()
 {
     inventory.Add(weapons.SMG);
     inventory.Add(weapons.ASSAULTRIFLE);
     inventory.Add(weapons.REVOLVER);
     ui = GameObject.FindGameObjectWithTag("Canvas").GetComponent <CanvasUi>();
 }
Example #2
0
    // Start is called before the first frame update
    void Start()
    {
        weaponHolder = GetComponent <WeaponHolderDictionary>();
        ui           = GameObject.FindGameObjectWithTag("Canvas").GetComponent <CanvasUi>();
        int tryMaxAmmo = 0;

        if (weaponHolder.WeaponsMaxAmmo.TryGetValue(currWeapon, out tryMaxAmmo))
        {
            maxAmmo = tryMaxAmmo;
        }
        ui.StartGettingText();
        ui.UpdateWeaponAndMaxAmmo(currWeapon.ToString(), currAmmo, maxAmmo);
    }