private void DrawRow(ResultRow dependency)
        {
            using (new EditorGUILayout.VerticalScope(EditorStyles.helpBox))
            {
                using (new EditorGUILayout.HorizontalScope())
                {
                    if (GUILayout.Button(dependency.LabelContent, Style.Instance.RowMainAssetBtn))
                    {
                        if (_click.IsDoubleClick(dependency.Main))
                        {
                            Selection.activeObject = dependency.Main;
                        }
                        else
                        {
                            EditorGUIUtility.PingObject(dependency.Main);
                        }

                        _click = new PrevClick(dependency.Main);
                    }
                    if (GUILayout.Button(Style.Instance.LookupBtn.Content, Style.Instance.LookupBtn.Style))
                    {
                        _postponedActions.Add(() =>
                                              Init(_data.Nest(dependency.Main)));
                    }
                }
                dependency.SerializedObject.Update();
                EditorGUI.BeginChangeCheck();
                if (dependency.Target)
                {
                    foreach (var prop in dependency.Properties)
                    {
                        using (new EditorGUILayout.HorizontalScope())
                        {
                            var locked = prop.Property.objectReferenceValue is MonoScript;
                            var f      = GUI.enabled;

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

                            EditorGUILayout.LabelField(prop.Content, Style.Instance.RowLabel, GUILayout.MaxWidth(_labelMaxWidth));
                            EditorGUILayout.PropertyField(prop.Property, GUIContent.none, true, GUILayout.MinWidth(_rowPropWidth));

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

                if (EditorGUI.EndChangeCheck())
                {
                    dependency.SerializedObject.ApplyModifiedProperties();
                }
            }
        }
Пример #2
0
        private void btnPrev_Click(object sender, EventArgs e)
        {
            // 防止卡死UI
            this.btnPrex.Invoke(new Action(() =>
            {
                this.lbTip.Text = string.Empty;
                if (PageabledEventArgs.PageIndex <= 1)
                {
                    PageabledEventArgs.PageIndex = 1;

                    this.lbTip.Text = "第1页";
                }
                else
                {
                    this.lbTip.Text = string.Empty;
                    PageabledEventArgs.PageIndex--;
                    PrevClick?.Invoke(sender, PageabledEventArgs);
                }
            }));
        }