|
|
|
@ -154,6 +154,7 @@ namespace Fungus
|
|
|
|
|
serializedObject.ApplyModifiedProperties(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static public void ObjectField<T>(SerializedProperty property, GUIContent label, GUIContent nullLabel, List<T> objectList) where T : Object |
|
|
|
|
{ |
|
|
|
|
if (property == null) |
|
|
|
@ -172,14 +173,16 @@ namespace Fungus
|
|
|
|
|
if (objectList[i] == null) continue; |
|
|
|
|
objectNames.Add(new GUIContent(objectList[i].name)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (selectedObject == objectList[i]) |
|
|
|
|
{ |
|
|
|
|
selectedIndex = i + 1; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
T result; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
selectedIndex = EditorGUILayout.Popup(label, selectedIndex, objectNames.ToArray()); |
|
|
|
|
if (selectedIndex == 0) |
|
|
|
|
{ |
|
|
|
@ -192,6 +195,7 @@ namespace Fungus
|
|
|
|
|
|
|
|
|
|
property.objectReferenceValue = result; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* When modifying custom editor code you can occasionally end up with orphaned editor instances. |
|
|
|
|