14using System.Reflection;
15using System.Collections.Generic;
23 void ConstrainValue(SerializedProperty property);
29 bool ShouldDisable(SerializedProperty property);
35 void DrawProperty(Rect rect, SerializedProperty property, GUIContent label);
42 void Draw(Rect rect, SerializedProperty property);
49 void Draw(Rect panelRect, SerializedProperty property);
55 Rect GetDropArea(Rect r, SerializedProperty property);
56 bool IsDropValid(
UnityObject[] draggedObjects, SerializedProperty property);
57 void ProcessDroppedObjects(
UnityObject[] droppedObjects, SerializedProperty property);
67 private bool _isInitialized =
false;
69 private FieldInfo _fieldInfo;
72 if (!_isInitialized) {
73 Debug.LogError(
"CombinablePropertyAttribute needed fieldInfo but was not "
74 +
"initialized. Did you call Init()?");
86 if (!_isInitialized) {
87 Debug.LogError(
"CombinablePropertyAttribute needed fieldInfo but was not "
88 +
"initialized. Did you call Init()?");
105 public void Init(SerializedProperty property) {
106 var propertyName =
property.name;
107 var serializedObject =
property.serializedObject;
108 var targetObjectType = serializedObject.targetObject.GetType();
109 fieldInfo = targetObjectType.GetField(propertyName,
110 BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance
111 | BindingFlags.FlattenHierarchy);
113 targets =
property.serializedObject.targetObjects;
115 _isInitialized =
true;
126 _isInitialized =
true;
129 public virtual IEnumerable<SerializedPropertyType> SupportedTypes {
135 public virtual void OnPropertyChanged(SerializedProperty property) { }
UnityEngine.Object UnityObject
UnityEngine.Object UnityObject