示例#1
0
    public void Switch()
    {
        if (currentWeapons.Count <= 1)
        {
            return;
        }

        index++;
        index = index % currentWeapons.Count;

        _weaponHand.SetWeapon(current);
        inventoryDisplay.SetWeapon(current);

        Game.Instance.audioManager.Play(switchSound);
    }
示例#2
0
    public void AttachToCharacter(PlayerCharacter character)
    {
        _currentActor = character.GetComponent <Actor>();
        _weaponHand   = character.GetComponentInChildren <WeaponHand>();
        currentWeapons.Clear();
        index = 0;

        foreach (var weapon in startWeapons)
        {
            currentWeapons.Add(weapon);
        }

        _weaponHand.SetWeapon(current);
        inventoryDisplay.SetWeapon(current);
        inventoryDisplay.Show();
    }
 public void SetWeapon(ItemWeapon weaponItem)
 {
     weaponHand.SetWeapon(weaponItem);
 }