/// <summary> /// Sets up the ammo type. /// Call in Awake(). /// </summary> private void InitializeAmmoType() { // if should randomize the ammo type if (randomizeAmmoType) { // get all weapon type set templates WeaponTypeSetTemplate[] wepTypes = AssetRefMethods.LoadAllBundleAssetWeaponTypeSetTemplate(); // get all weapoon types that need ammo to be used List<WeaponTypeSetTemplate> ammoBasedWepTypes = wepTypes.Where (iterSet => iterSet.template.doesNeedAmmo).ToList(); // get random index of ammo wep type list int randomIndex = Random.Range(0, ammoBasedWepTypes.Count); // set ammo type to random list entry ammoType = ammoBasedWepTypes[randomIndex]; } // MAYBE TODO: change pickup model based on ammo type }
public WeaponTypeSet(WeaponTypeSetTemplate templateArg) { Setup(templateArg.template); }