Пример #1
0
 public void UpdateAttributes(VFXPropertyAttribute[] attributes, bool notify)
 {
     if (notify)
     {
         if (!VFXPropertyAttribute.IsEqual(m_Property.attributes, attributes))
         {
             m_Property.attributes = attributes;
             Invalidate(InvalidationCause.kUIChangedTransient); // TODO This will trigger a setDirty while it shouldn't as property attributes are not serialized
         }
     }
     else // fast path without comparison
     {
         m_Property.attributes = attributes;
     }
 }
Пример #2
0
        public static Vector2 FindRange(VFXPropertyAttribute[] attributes)
        {
            if (attributes != null)
            {
                VFXPropertyAttribute attribute = attributes.FirstOrDefault(o => o.m_Type == Type.kRange);
                if (attribute != null)
                {
                    return(new Vector2(attribute.m_Min, attribute.m_Max));
                }

                attribute = attributes.FirstOrDefault(o => o.m_Type == Type.kMin);
                if (attribute != null)
                {
                    return(new Vector2(attribute.m_Min, Mathf.Infinity));
                }
            }

            return(Vector2.zero);
        }
Пример #3
0
 public VFXProperty(FieldInfo info)
 {
     name             = info.Name;
     m_serializedType = info.FieldType;
     attributes       = VFXPropertyAttribute.Create(info.GetCustomAttributes(true));
 }