AddColorItemsToGenericMenu() public static method

public static AddColorItemsToGenericMenu ( GenericMenu menu, AudioMixerGroupController groups ) : void
menu GenericMenu
groups UnityEditor.Audio.AudioMixerGroupController
return void
        private void OpenGroupContextMenu(AudioMixerTreeViewNode audioNode, bool visible)
        {
            GenericMenu genericMenu = new GenericMenu();

            if (this.NodeWasToggled != null)
            {
                genericMenu.AddItem(new GUIContent((!visible) ? "Show Group" : "Hide group"), false, delegate
                {
                    this.NodeWasToggled(audioNode, !visible);
                });
            }
            genericMenu.AddSeparator(string.Empty);
            AudioMixerGroupController[] groups;
            if (this.m_Controller.CachedSelection.Contains(audioNode.group))
            {
                groups = this.m_Controller.CachedSelection.ToArray();
            }
            else
            {
                groups = new AudioMixerGroupController[]
                {
                    audioNode.group
                };
            }
            AudioMixerColorCodes.AddColorItemsToGenericMenu(genericMenu, groups);
            genericMenu.ShowAsContext();
        }
Example #2
0
        private void OpenGroupContextMenu(AudioMixerTreeViewNode audioNode, bool visible)
        {
            GenericMenu genericMenu = new GenericMenu();

            if (this.NodeWasToggled != null)
            {
                genericMenu.AddItem(new GUIContent((!visible) ? "Show Group" : "Hide group"), false, delegate
                {
                    this.NodeWasToggled(audioNode, !visible);
                });
            }
            genericMenu.AddSeparator(string.Empty);
            AudioMixerColorCodes.AddColorItemsToGenericMenu(genericMenu, audioNode.group);
            genericMenu.ShowAsContext();
        }
        void OpenGroupContextMenu(AudioMixerTreeViewNode audioNode, bool visible)
        {
            GenericMenu menu = new GenericMenu();

            if (NodeWasToggled != null)
            {
                menu.AddItem(new GUIContent(visible ? "Hide group" : "Show Group"), false, () => NodeWasToggled(audioNode, !visible));
            }
            menu.AddSeparator(string.Empty);

            AudioMixerGroupController[] groups;
            if (m_Controller.CachedSelection.Contains(audioNode.group))
            {
                groups = m_Controller.CachedSelection.ToArray();
            }
            else
            {
                groups = new AudioMixerGroupController[] { audioNode.group }
            };

            AudioMixerColorCodes.AddColorItemsToGenericMenu(menu, groups);
            menu.ShowAsContext();
        }
Example #4
0
        private void OpenGroupContextMenu(AudioMixerTreeViewNode audioNode, bool visible)
        {
            // ISSUE: object of a compiler-generated type is created
            // ISSUE: variable of a compiler-generated type
            AudioGroupTreeViewGUI.\u003COpenGroupContextMenu\u003Ec__AnonStorey64 menuCAnonStorey64 = new AudioGroupTreeViewGUI.\u003COpenGroupContextMenu\u003Ec__AnonStorey64();
            // ISSUE: reference to a compiler-generated field
            menuCAnonStorey64.audioNode = audioNode;
            // ISSUE: reference to a compiler-generated field
            menuCAnonStorey64.visible = visible;
            // ISSUE: reference to a compiler-generated field
            menuCAnonStorey64.\u003C\u003Ef__this = this;
            GenericMenu menu = new GenericMenu();

            if (this.NodeWasToggled != null)
            {
                // ISSUE: reference to a compiler-generated field
                // ISSUE: reference to a compiler-generated method
                menu.AddItem(new GUIContent(!menuCAnonStorey64.visible ? "Show Group" : "Hide group"), false, new GenericMenu.MenuFunction(menuCAnonStorey64.\u003C\u003Em__B2));
            }
            menu.AddSeparator(string.Empty);
            AudioMixerGroupController[] groups;
            // ISSUE: reference to a compiler-generated field
            if (this.m_Controller.CachedSelection.Contains(menuCAnonStorey64.audioNode.group))
            {
                groups = this.m_Controller.CachedSelection.ToArray();
            }
            else
            {
                // ISSUE: reference to a compiler-generated field
                groups = new AudioMixerGroupController[1]
                {
                    menuCAnonStorey64.audioNode.group
                };
            }
            AudioMixerColorCodes.AddColorItemsToGenericMenu(menu, groups);
            menu.ShowAsContext();
        }