예제 #1
0
 public WeaponTags(WeaponType aWeaponType, WeaponDistance aWeaponDistance, int aDmgMin, int aDmgMax, int aArmorPenetration, int aCritChance, int aCritMulti,
                   AttackTags aAttackTags1, AttackTags aAttackTags2, AttackTags aAttackTags3)
 {
     armorPenetration = aArmorPenetration;
     critChance       = aCritChance;
     critMulti        = aCritMulti;
     dmgMax           = aDmgMax;
     dmgMin           = aDmgMin;
     weaponDistance   = aWeaponDistance;
     weaponType       = aWeaponType;
     attack1          = aAttackTags1;
     attack2          = aAttackTags2;
     attack3          = aAttackTags3;
 }
예제 #2
0
    public bool SelectWeapon(WeaponType weaponType)
    {
        var temp = currentWeapon;

        foreach (var weapon in weapons)
        {
            if (weapon.Weapon.WeaponType == weaponType)
            {
                temp = weapon;
                break;
            }
        }
        if (temp != null && !currentWeapon.Weapon.IsAttack)
        {
            currentWeapon.Weapon.WeaponObject.SetActive(false);
            currentWeapon = temp;
            currentWeapon.Weapon.WeaponObject.SetActive(true);
            return(true);
        }
        return(false);
    }
예제 #3
0
 public void AddWeapon(WeaponDistance weapon)
 {
     weapons.Add(weapon);
     weapon.Weapon.WeaponObject.SetActive(false);
 }
예제 #4
0
 private void Start()
 {
     currentWeapon = weapons[0];
 }