private void SetEquippedWeaponInSlot(WeaponIdentifier weaponIdentifer) { WeaponPath weaponPath = WeaponPaths[(int)weaponIdentifer]; Slots[weaponPath.SlotIndex].EquippedWeaponCounter = weaponPath.WeaponIndex; CurrentSlot = weaponPath.SlotIndex; }
public void AddEquippedWeapon(WeaponIdentifier weaponIdentifier) { WeaponPath weaponPath = WeaponPaths[(int)weaponIdentifier]; if (weaponPath != null) { Slots[weaponPath.SlotIndex].EquippedWeaponCounter = weaponPath.WeaponIndex; } }
////////////////////////////////////////////////////////////// // Weapon activation public void ActivateWeapon(WeaponIdentifier weaponIdentifier) { WeaponPath weaponPath = WeaponPaths[(int)weaponIdentifier]; if (weaponPath != null) { GetCurrentWeapon().gameObject.SetActive(false); SetCurrentWeapon(weaponIdentifier); SetEquippedWeaponInSlot(weaponIdentifier); GetCurrentWeapon().gameObject.SetActive(true); UpdateCharacterHands(_avatar.Characters[_avatar.CharacterId]); } }
private void BuildWeaponPaths() { int weaponCount = Enum.GetNames(typeof(WeaponIdentifier)).Length; WeaponPaths = new WeaponPath[weaponCount]; for (int slotCounter = 0; slotCounter < Slots.Count; slotCounter++) { WeaponSlot weaponSlot = Slots[slotCounter]; for (int weaponCounter = 0; weaponCounter < weaponSlot.Weapons.Count; weaponCounter++) { WeaponIdentifier weaponIndentifier = weaponSlot.Weapons[weaponCounter].Identifier; WeaponPaths[(int)weaponIndentifier] = new WeaponPath(slotCounter, weaponCounter); } } }
public F3DGenericWeapon GetCurrentWeapon() { WeaponPath weaponPath = WeaponPaths[(int)CurrentWeapon]; return(Slots[weaponPath.SlotIndex].Weapons[weaponPath.WeaponIndex]); }