コード例 #1
0
        public override void OnInspectorGUI()
        {
            base.OnInspectorGUI();

            EGUI.Vertical(() => {
                EGUI.Horizontal(() => {
                    EditorGUILayout.Toggle("Opened", Target.IsOpened);
                    EditorGUILayout.Toggle("In Transition", Target.IsInTransition);
                });
                EGUI.Horizontal(() => {
                    EditorGUILayout.Toggle("Disabled", Target.IsDisabled);
                    EditorGUILayout.Toggle("Interactable", Target.IsInteractable);
                });
                EGUI.Horizontal(() => {
                    EditorGUILayout.Toggle("Focused", Target.IsFocusedThis);
                });
            });
        }
コード例 #2
0
        private void DrawComponentGroup(UIComponentGroup componentGroup)
        {
            EGUI.Horizontal(() => {
                GUILayout.Space(10);

                var style   = new GUIStyle(EditorStyles.label);
                var postfix = string.Empty;

                if (componentGroup == Target)
                {
                    style.fontStyle = FontStyle.Bold;
                    postfix         = "(this)";
                }

                EditorGUILayout.PrefixLabel(componentGroup.gameObject.name + postfix, style, style);

                EditorGUILayout.ObjectField(componentGroup.gameObject,
                                            typeof(GameObject), true);

                GUILayout.Label("Auto Open");

                var autoOpen = componentGroup.Component.OpenType == UIOpenType.Auto;

                if (EditorGUILayout.Toggle(autoOpen) != autoOpen)
                {
                    if (autoOpen)
                    {
                        componentGroup.Component.OpenType = UIOpenType.Manual;
                    }
                    else
                    {
                        SetGroupToAutoOpen(componentGroup);
                    }
                }
            });
        }