// Get properties with values from slots
 protected static IEnumerable <VFXPropertyWithValue> PropertiesFromSlots(IEnumerable <VFXSlot> slots)
 {
     return(slots.Select(s =>
     {
         var p = new VFXPropertyWithValue();
         p.property = s.property;
         p.value = s.value;
         return p;
     }));
 }
        // Get properties with value from type fields
        protected static IEnumerable <VFXPropertyWithValue> PropertiesFromType(Type type)
        {
            if (type == null)
            {
                return(Enumerable.Empty <VFXPropertyWithValue>());
            }

            var instance = System.Activator.CreateInstance(type);

            return(type.GetFields()
                   .Where(f => !f.IsStatic)
                   .Select(f => {
                var p = new VFXPropertyWithValue();
                p.property = new VFXProperty(f);
                p.value = f.GetValue(instance);
                return p;
            }));
        }
예제 #3
0
 public static VFXSlot Create(VFXPropertyWithValue property, Direction direction)
 {
     return(Create(property.property, direction, property.value));
 }