Beispiel #1
0
    // Use this for initialization
    void Awake()
    {
        IWeaponAnimation  weaponAnimation = new WeaponAnimationInfo(weaponAnimations.OnEquipTime, weaponAnimations.UnequipTime);
        List <ISlashInfo> slashes         = new List <ISlashInfo>();

        for (int i = 0; i < meleeAttacks.Slashes.Count; i++)
        {
            slashes.Add(meleeAttacks.Slashes[i]);
        }
        ISlashLogic slashLogic = new SlashLogic(meleeAttacks.TimeToWait, ref slashes);

        IRangedWeaponInfo weaponInfo = new RangedWeaponInfo
                                       (
            rangedWeaponInfo.WeaponName, rangedWeaponInfo.Damage,
            rangedWeaponInfo.NumberOfAmmoInMagazine, rangedWeaponInfo.MaximumMagazineSize,
            rangedWeaponInfo.ReloadTime, rangedWeaponInfo.ShootDurationTime,
            rangedWeaponInfo.WeaponType, slashLogic,
            bulletSpawn, rangedWeaponInfo.DamagableLayer
                                       );

        IWeaponPlace weaponPlace = new WeaponPlaces(ref idle, ref use);

        this.rangedWeapon = new RangedWeapon(ref weaponAnimation, ref weaponInfo, ref weaponPlace, this.transform);
        this.rangedWeapon.PlaceWeapon(true);
        this.weaponRenderer = GetComponent <LineRenderer>();
    }
Beispiel #2
0
    private void Awake()
    {
        IWeaponAnimation  weaponAnimation = new WeaponAnimationInfo(weaponAnimations.OnEquipTime, weaponAnimations.UnequipTime);
        List <ISlashInfo> slashes         = new List <ISlashInfo>();

        for (int i = 0; i < meleeAttacks.Slashes.Count; i++)
        {
            slashes.Add(meleeAttacks.Slashes[i]);
        }
        ISlashLogic slashLogic = new SlashLogic(meleeAttacks.TimeToWait, ref slashes);

        IWeaponInfo weaponInfo = new MeleeWeaponInfo(slashLogic, baseWeaponInfo.WeaponName);

        IWeaponPlace weaponPlace = new WeaponPlaces(ref idle, ref use);

        this.meleeWeapon = new Weapon(ref weaponAnimation, ref weaponInfo, ref weaponPlace, this.transform);
        this.meleeWeapon.PlaceWeapon(true);
    }