コード例 #1
0
        static void DrawRowScene(SearchResultGui gui)
        {
            EditorGUI.BeginChangeCheck();
            // if (data.TargetGo || data.TargetComponent)
            foreach (var prop in gui.Properties)
            {
                {
                    var locked = prop.Property.objectReferenceValue is MonoScript;
                    var f      = GUI.enabled;

                    if (locked)
                    {
                        GUI.enabled = false;
                    }

                    EditorGUILayout.PropertyField(prop.Property, prop.Content, false);

                    if (locked)
                    {
                        GUI.enabled = f;
                    }
                }
            }

            if (EditorGUI.EndChangeCheck())
            {
                gui.SerializedObject.ApplyModifiedProperties();
            }
        }
コード例 #2
0
        static void DrawRowFile(Result data, SearchResultGui gui, WindowData windowData)
        {
            using (new EditorGUILayout.VerticalScope(EditorStyles.helpBox)) {
                var buf    = GUI.color;
                var pingGo = data.MainFile == null ? data.RootGo : data.MainFile;
                if (GUILayout.Button(gui.Label, windowData.Style.RowMainAssetBtn))
                {
                    if (windowData.Click.IsDoubleClick(pingGo))
                    {
                        // _selectionChangedByArrows = false;
                        Selection.activeObject = pingGo;
                    }
                    else
                    {
                        EditorGUIUtility.PingObject(pingGo);
                    }

                    windowData.Click = new PrevClick(pingGo);
                }

                GUI.color = buf;

                EditorGUI.BeginChangeCheck();
                if (data.File)
                {
                    foreach (var prop in gui.Properties)
                    {
                        using (new EditorGUILayout.HorizontalScope()) {
                            var locked = prop.Property.objectReferenceValue is MonoScript;
                            var f      = GUI.enabled;
                            if (locked)
                            {
                                GUI.enabled = false;
                            }
                            EditorGUILayout.PropertyField(prop.Property, prop.Content, false);
                            if (locked)
                            {
                                GUI.enabled = f;
                            }
                        }
                    }
                }

                if (EditorGUI.EndChangeCheck())
                {
                    gui.SerializedObject.ApplyModifiedProperties();
                    // dependency.SerializedObject.Update();
                }
            }
        }