public static void SetGroupToAutoOpen(UIComponentGroup group) { if (!group) { return; } group.Component.OpenType = UIOpenType.Auto; var allGroups = SceneTools.FindSceneObjectsOfType <UIComponentGroup>(); foreach (var otherGroup in allGroups) { if (otherGroup != group && otherGroup.GroupId == group.GroupId && otherGroup.Component.OpenType == UIOpenType.Auto) { otherGroup.Component.OpenType = UIOpenType.Manual; } } }
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); } } }); }