Пример #1
0
        public static void ShowTrackContextMenu(TrackDrawer drawer, TrackAsset track, Vector2 mousePosition)
        {
            var menu = new GenericMenu();

            TimelineAction.AddToMenu(menu, TimelineWindow.instance.state, mousePosition);
            menu.AddSeparator("");

            TrackAction.AddToMenu(menu, TimelineWindow.instance.state);

            var groupTrack = track as GroupTrack;

            if (groupTrack == null)
            {
                if (drawer != null)
                {
                    drawer.OnBuildTrackContextMenu(menu, track, TimelineWindow.instance.state);
                }
            }
            else
            {
                // Add all the track types..
                menu.AddSeparator("");
                TimelineGroupGUI.AddMenuItems(menu, groupTrack);
            }

            menu.ShowAsContext();
        }
        public static void Show(TrackDrawer drawer, TrackAsset track, Vector2 mousePosition)
        {
            GenericMenu genericMenu = new GenericMenu();

            TimelineAction.AddToMenu(genericMenu, TimelineWindow.instance.state);
            genericMenu.AddSeparator("");
            TrackAction.AddToMenu(genericMenu, TimelineWindow.instance.state);
            GroupTrack groupTrack = track as GroupTrack;

            if (groupTrack == null)
            {
                if (drawer != null)
                {
                    genericMenu.AddSeparator("");
                    drawer.OnBuildTrackContextMenu(genericMenu, track, TimelineWindow.instance.state);
                }
            }
            else
            {
                genericMenu.AddSeparator("");
                TimelineGroupGUI.AddMenuItems(genericMenu, groupTrack);
            }
            genericMenu.ShowAsContext();
        }