public static void SetLivePopupEditor(DynamicUMADnaAssetEditor liveDUDAEditor)
 {
     if (Application.isPlaying)
     {
         _livePopupEditor = liveDUDAEditor;
     }
 }
Exemplo n.º 2
0
 public void OnShowPopupInspector(EditorWindow newInspectorPopup)
 {
     if (inspectorPopup != null && inspectorPopup != newInspectorPopup)
     {
         inspectorPopup.Close();
         DynamicUMADnaAssetEditor.SetLivePopupEditor(null);
     }
     inspectorPopup = newInspectorPopup;
 }
Exemplo n.º 3
0
        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);
                        }
                    }
                }
            }
        }