示例#1
0
        private void AddContainer()
        {
            GenericMenu menu = new GenericMenu();

            bool hasDefaultContainers = false;

            List <FColorSetting> defaultContainers = FUtility.GetSettings().DefaultContainers;

            foreach (FColorSetting colorSetting in defaultContainers)
            {
                if (string.IsNullOrEmpty(colorSetting._str))
                {
                    continue;
                }

                menu.AddItem(new GUIContent(colorSetting._str), false, CreateContainer, colorSetting);
                hasDefaultContainers = true;
            }

            if (!hasDefaultContainers)
            {
                _sequenceWindow.GetSequenceEditor().CreateContainer(new FColorSetting("Default", FGUI.DefaultContainerColor()));
                return;
            }

            menu.AddSeparator(null);

            menu.AddItem(new GUIContent("[Default New Container]"), false, CreateContainer, new FColorSetting("Default", FGUI.DefaultContainerColor()));

            menu.ShowAsContext();
        }
示例#2
0
        protected override void OnHeaderInput(Rect labelRect, Rect iconRect)
        {
            if (Event.current.type == EventType.MouseDown && Event.current.clickCount > 1 && labelRect.Contains(Event.current.mousePosition))
            {
                Selection.activeTransform = Container.Owner;
                Event.current.Use();
            }
            base.OnHeaderInput(labelRect, iconRect);

            if (Event.current.type == EventType.MouseDown && iconRect.Contains(Event.current.mousePosition))
            {
                FSettings         fSettings = FUtility.GetSettings();
                FContainerSetting setting   = fSettings.ContainerType.Find(c => c._type == Container.ConatinerType);
                if (setting == null)
                {
                    ShowAddTrackMenu();
                }
                else
                {
                    ShowAddTrackMenuBaseOnType(setting);
                }
            }
        }