Esempio n. 1
0
    void OnEnable()
    {
        m_Target = target as Weapon;
        m_EquippedEffectListProperty     = serializedObject.FindProperty(nameof(Weapon.EquippedEffects));
        m_WeaponAttackEffectListProperty = serializedObject.FindProperty(nameof(Weapon.AttackEffects));

        m_MinimumStrengthProperty = serializedObject.FindProperty(nameof(EquipmentItem.MinimumStrength));
        m_MinimumAgilityProperty  = serializedObject.FindProperty(nameof(EquipmentItem.MinimumAgility));
        m_MinimumDefenseProperty  = serializedObject.FindProperty(nameof(EquipmentItem.MinimumDefense));

        m_WeaponStatProperty = serializedObject.FindProperty(nameof(Weapon.Stats));

        m_HitSoundProps   = serializedObject.FindProperty(nameof(Weapon.HitSounds));
        m_SwingSoundProps = serializedObject.FindProperty(nameof(Weapon.SwingSounds));

        m_ItemEditor = new ItemEditor();
        m_ItemEditor.Init(serializedObject);

        var lookup = typeof(EquipmentItem.EquippedEffect);

        m_AvailableEquipEffectType = System.AppDomain.CurrentDomain.GetAssemblies()
                                     .SelectMany(assembly => assembly.GetTypes())
                                     .Where(x => x.IsClass && !x.IsAbstract && x.IsSubclassOf(lookup))
                                     .Select(type => type.Name)
                                     .ToList();

        lookup = typeof(Weapon.WeaponAttackEffect);
        m_AvailableWeaponAttackEffectType = System.AppDomain.CurrentDomain.GetAssemblies()
                                            .SelectMany(assembly => assembly.GetTypes())
                                            .Where(x => x.IsClass && !x.IsAbstract && x.IsSubclassOf(lookup))
                                            .Select(type => type.Name)
                                            .ToList();
    }
Esempio n. 2
0
    void OnEnable()
    {
        m_Target = target as UsableItem;
        m_UsageEffectListProperty = serializedObject.FindProperty(nameof(UsableItem.UsageEffects));

        m_ItemEditor = new ItemEditor();
        m_ItemEditor.Init(serializedObject);

        var lookup = typeof(UsableItem.UsageEffect);

        m_AvailableUsageType = System.AppDomain.CurrentDomain.GetAssemblies()
                               .SelectMany(assembly => assembly.GetTypes())
                               .Where(x => x.IsClass && !x.IsAbstract && x.IsSubclassOf(lookup))
                               .Select(type => type.Name)
                               .ToList();
    }