using System.Collections.Generic; using System.Linq; using UnityEngine; using UnityEngine.UIElements; using UnityEngine.Profiling; using UnityEngine.VFX; using Object = UnityEngine.Object; using Type = System.Type; namespace UnityEditor.VFX.UI { interface IPropertyRMProvider { bool expanded { get; } bool expandable { get; } bool expandableIfShowsEverything { get; } object value { get; set; } bool spaceableAndMasterOfSpace { get; } VFXSpace space { get; set; } bool IsSpaceInherited(); string name { get; } VFXPropertyAttributes attributes { get; } object[] customAttributes { get; } Type portType { get; } int depth { get; } bool editable { get; } IEnumerable filteredOutEnumerators { get; } void RetractPath(); void ExpandPath(); void StartLiveModification(); void EndLiveModification(); } class SimplePropertyRMProvider : IPropertyRMProvider { System.Func m_Getter; System.Action m_Setter; string m_Name; public SimplePropertyRMProvider(string name, System.Func getter, System.Action setter) { m_Getter = getter; m_Setter = setter; m_Name = name; } VFXSpace IPropertyRMProvider.space { get { return VFXSpace.Local; } set { } } bool IPropertyRMProvider.IsSpaceInherited() { return false; } bool IPropertyRMProvider.spaceableAndMasterOfSpace { get { return false; } } bool IPropertyRMProvider.expanded { get { return false; } } bool IPropertyRMProvider.expandable { get { return false; } } bool IPropertyRMProvider.expandableIfShowsEverything { get { return false; } } object IPropertyRMProvider.value { get { return m_Getter(); } set { m_Setter((T)value); } } public virtual IEnumerable filteredOutEnumerators { get { return null; } } string IPropertyRMProvider.name { get { return m_Name; } } VFXPropertyAttributes IPropertyRMProvider.attributes { get { return new VFXPropertyAttributes(); } } object[] IPropertyRMProvider.customAttributes { get { return null; } } Type IPropertyRMProvider.portType { get { return typeof(T); } } int IPropertyRMProvider.depth { get { return 0; } } bool IPropertyRMProvider.editable { get { return true; } } void IPropertyRMProvider.RetractPath() { } void IPropertyRMProvider.ExpandPath() { } void IPropertyRMProvider.StartLiveModification() { } void IPropertyRMProvider.EndLiveModification() { } } abstract class PropertyRM : VisualElement { public abstract void SetValue(object obj); public abstract object GetValue(); public virtual void SetMultiplier(object obj) { } Clickable m_IconClickable; static Texture2D[] m_IconStates; public bool m_PropertyEnabled; public bool propertyEnabled { get { return m_PropertyEnabled; } set { m_PropertyEnabled = value; UpdateEnabled(); } } public bool m_Indeterminate; public bool indeterminate { get { return m_Indeterminate; } set { m_Indeterminate = value; UpdateIndeterminate(); } } public float labelWidth { get; private set; } public virtual bool isDelayed { get; set; } protected bool hasChangeDelayed { get; set; } public virtual bool IsCompatible(IPropertyRMProvider provider) { return GetType() == GetPropertyType(provider); } public const float depthOffset = 10; public float GetPreferredLabelWidth() { if (hasLabel && this.Q