public override void OnInspectorGUI()
        {
            conditionsListProperty.serializedObject.Update();

            // For some reason re-ordering the conditions won't work without
            // this line. I'm not sure if there is some weird caching that's occuring
            // somewhere or what. Feels hackish, but leaving for now
            if (Event.current.type == EventType.Layout)
            {
                ClearEditors();
            }

            EditorGUILayout.BeginVertical();

            EditorGUI.BeginChangeCheck();

            conditionList.DoLayoutList();

            RenderSelectedEditor();

            if (EditorGUI.EndChangeCheck())
            {
                SceneManagerEditorWindow activeWindow = SceneManagerEditorWindow.TryGetExistingWindow();
                activeWindow.RefreshStatuses();

                conditionsListProperty.serializedObject.ApplyModifiedProperties();
            }

            EditorGUILayout.EndVertical();
        }
예제 #2
0
        private void DrawIdentificationInfo(bool isAnyScene)
        {
            EditorGUI.BeginDisabledGroup(isAnyScene);

            EditorGUI.BeginChangeCheck();

            EditorGUILayout.PropertyField(serializedScene.SceneNameProp);

            EditorGUILayout.BeginHorizontal();

            EditorGUILayout.TextField("Scene Path: ", serializedScene.AssetPathProp.stringValue);

            Rect scenePathRect = GUILayoutUtility.GetLastRect();

            scenePathDragReceiver.ReceiverBox = scenePathRect.WithPosition(
                GUIUtility.GUIToScreenPoint(scenePathRect.position));

            if (GUILayout.Button("Ping", GUILayout.MaxWidth(40f)))
            {
                UnityEngine.Object asset = AssetDatabase.LoadMainAssetAtPath(
                    serializedScene.AssetPathProp.stringValue);
                EditorGUIUtility.PingObject(asset);
            }

            EditorGUILayout.EndHorizontal();

            scenePathDragReceiver.Update();
            EditorGUILayout.PropertyField(serializedScene.UseAnySceneTransProp);

            if (EditorGUI.EndChangeCheck())
            {
                serializedScene.SerializedObject.ApplyModifiedProperties();

                SceneManagerEditorWindow nodeEditor = SceneManagerEditorWindow.TryGetExistingWindow();

                if (nodeEditor != null)
                {
                    nodeEditor.Repaint();
                }
            }

            EditorGUI.EndDisabledGroup();
        }