public void ResetWeaponsList(){ //save bullets remaining in previous weapon currentWeap.bulletsInMyChamber = play.bulletsLeft; currentWeap = weaponList[currentWeaponIndex]; play.bulletMaxCapacity = currentWeap.clipSize; play.bulletsLeft = currentWeap.bulletsInMyChamber; RefreshWeaponDisplay(); }
void LoadWeaponsList() { foreach(GameObject g in weaponPrefabList) { GameObject weapon = Instantiate(g, gunBackgroundReference.transform); weapon.transform.SetSiblingIndex(0); weaponList.Add(weapon.GetComponent<WeaponInfoScript>()); weapon.SetActive(false); } currentWeap = weaponList[currentWeaponIndex]; ResetWeaponsList(); }