示例#1
0
    protected override List <ItemComponent> GetComponents()
    {
        ItemComponent[] components = null;

        switch (weaponType)
        {
        case WeaponType.Primary:
            components = new ItemComponent[]
            {
                new WeaponComponent(weaponPrefab),
                new EquipPrimaryComponent(),
            };
            break;

        case WeaponType.Secondary:
            components = new ItemComponent[]
            {
                new WeaponComponent(weaponPrefab),
                new EquipSecondaryComponent(),
            };
            break;
        }

        return(components.ToList());
    }