public static void SetLivePopupEditor(DynamicUMADnaAssetEditor liveDUDAEditor) { if (Application.isPlaying) { _livePopupEditor = liveDUDAEditor; } }
public void OnShowPopupInspector(EditorWindow newInspectorPopup) { if (inspectorPopup != null && inspectorPopup != newInspectorPopup) { inspectorPopup.Close(); DynamicUMADnaAssetEditor.SetLivePopupEditor(null); } inspectorPopup = newInspectorPopup; }
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) { GUIHelper.InspectableObjectField(position, property, label, OnShowPopupInspector); //We need to check this a few times because when the inspector window is created by InspectorUtility.InspectTarget //when the user clicks the inspect button next to the field that is drawn above, //GetInspectorsEditors doesnt return the actual editors correctly until the popup window repaints if (inspectorPopup != null && DynamicUMADnaAssetEditor.livePopupEditor == null) { var editors = InspectorUtlity.GetInspectorsEditors(inspectorPopup); for (int i = 0; i < editors.Length; i++) { if (editors[i].GetType() == typeof(DynamicUMADnaAssetEditor)) { if (editors[i].target == property.objectReferenceValue) { DynamicUMADnaAssetEditor.SetLivePopupEditor(editors[i] as DynamicUMADnaAssetEditor); } } } } }