static void EditModeToolbarGUI(TimelineMode mode)
        {
            using (new EditorGUI.DisabledScope(mode.EditModeButtonsState(instance.state) == TimelineModeGUIState.Disabled))
            {
                var editType = EditMode.editType;

                using (var checkScope = new EditorGUI.ChangeCheckScope())
                {
                    var icon = editType == EditMode.EditType.Mix ? DirectorStyles.mixOn : DirectorStyles.mixOff;
                    GUILayout.Toggle(editType == EditMode.EditType.Mix, icon, DirectorStyles.Instance.editModeMixBtn);
                    if (checkScope.changed)
                    {
                        EditMode.editType = EditMode.EditType.Mix;
                    }
                }
                using (var checkScope = new EditorGUI.ChangeCheckScope())
                {
                    var icon = editType == EditMode.EditType.Ripple ? DirectorStyles.rippleOn : DirectorStyles.rippleOff;
                    GUILayout.Toggle(editType == EditMode.EditType.Ripple, icon, DirectorStyles.Instance.editModeRippleBtn);
                    if (checkScope.changed)
                    {
                        EditMode.editType = EditMode.EditType.Ripple;
                    }
                }
                using (var checkScope = new EditorGUI.ChangeCheckScope())
                {
                    var icon = editType == EditMode.EditType.Replace ? DirectorStyles.replaceOn : DirectorStyles.replaceOff;
                    GUILayout.Toggle(editType == EditMode.EditType.Replace, icon, DirectorStyles.Instance.editModeReplaceBtn);
                    if (checkScope.changed)
                    {
                        EditMode.editType = EditMode.EditType.Replace;
                    }
                }
            }
        }
        static void EditModeToolbarGUI(TimelineMode mode)
        {
            using (new EditorGUI.DisabledScope(mode.EditModeButtonsState(instance.state) == TimelineModeGUIState.Disabled))
            {
                var editType = EditMode.editType;

                EditorGUI.BeginChangeCheck();
                var mixIcon = editType == EditMode.EditType.Mix ? DirectorStyles.mixOn : DirectorStyles.mixOff;
                GUILayout.Toggle(editType == EditMode.EditType.Mix, mixIcon, DirectorStyles.Instance.editModeBtn);
                if (EditorGUI.EndChangeCheck())
                {
                    EditMode.editType = EditMode.EditType.Mix;
                }

                EditorGUI.BeginChangeCheck();
                var rippleIcon = editType == EditMode.EditType.Ripple ? DirectorStyles.rippleOn : DirectorStyles.rippleOff;
                GUILayout.Toggle(editType == EditMode.EditType.Ripple, rippleIcon, DirectorStyles.Instance.editModeBtn);
                if (EditorGUI.EndChangeCheck())
                {
                    EditMode.editType = EditMode.EditType.Ripple;
                }

                EditorGUI.BeginChangeCheck();
                var replaceIcon = editType == EditMode.EditType.Replace ? DirectorStyles.replaceOn : DirectorStyles.replaceOff;
                GUILayout.Toggle(editType == EditMode.EditType.Replace, replaceIcon, DirectorStyles.Instance.editModeBtn);
                if (EditorGUI.EndChangeCheck())
                {
                    EditMode.editType = EditMode.EditType.Replace;
                }
            }
        }
Пример #3
0
        static void EditModeToolbarGUI(TimelineMode mode)
        {
            using (new EditorGUI.DisabledScope(mode.EditModeButtonsState(instance.state) == TimelineModeGUIState.Disabled))
            {
                var editType = EditMode.editType;

                k_EditModes[0] = editType == EditMode.EditType.Mix ? DirectorStyles.mixOn : DirectorStyles.mixOff;
                k_EditModes[1] = editType == EditMode.EditType.Ripple ? DirectorStyles.rippleOn : DirectorStyles.rippleOff;
                k_EditModes[2] = editType == EditMode.EditType.Replace ? DirectorStyles.replaceOn : DirectorStyles.replaceOff;

                var newEditType = (EditMode.EditType)GUILayout.Toolbar((int)editType, k_EditModes, DirectorStyles.Instance.editModesToolbar);
                if (newEditType != editType)
                {
                    EditMode.editType = newEditType;
                }
            }
        }