public bool AddSpecialWeapon(ISpecialWeapon weapon) { if (Enum.IsDefined(typeof(_weaponsID), weapon.ID) && specialWeapons.Count < SPECIALINVENTORYCAPACITY) { specialWeapons.Add(weapon); weapon.CanUse = true; return(true); } else { return(false); } }
// Use this for initialization void Start() { _isSpecial = true; inv = GameObject.Find("Inventory").GetComponent <Inventory>(); var downloadStrings = this.gameObject.name.Split(new[] { '(' }, 2); nameW = downloadStrings[0]; nameW = nameW.Replace(" ", string.Empty); if (_weaponNames.Contains(nameW)) { weapon = GameObject.Find("Inventory").GetComponent(nameW) as ISpecialWeapon; } }