コード例 #1
0
    private void SetEquippedWeaponInSlot(WeaponIdentifier weaponIdentifer)
    {
        WeaponPath weaponPath = WeaponPaths[(int)weaponIdentifer];

        Slots[weaponPath.SlotIndex].EquippedWeaponCounter = weaponPath.WeaponIndex;
        CurrentSlot = weaponPath.SlotIndex;
    }
コード例 #2
0
    public void AddEquippedWeapon(WeaponIdentifier weaponIdentifier)
    {
        WeaponPath weaponPath = WeaponPaths[(int)weaponIdentifier];

        if (weaponPath != null)
        {
            Slots[weaponPath.SlotIndex].EquippedWeaponCounter = weaponPath.WeaponIndex;
        }
    }
コード例 #3
0
    //////////////////////////////////////////////////////////////

    // 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]);
        }
    }
コード例 #4
0
    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);
            }
        }
    }
コード例 #5
0
    public F3DGenericWeapon GetCurrentWeapon()
    {
        WeaponPath weaponPath = WeaponPaths[(int)CurrentWeapon];

        return(Slots[weaponPath.SlotIndex].Weapons[weaponPath.WeaponIndex]);
    }