public void Layout(Rect position, Action repaintCallback)
        {
            EditorGUILayout.HelpBox(@"Limited Lipsync is a feature that will not work with the version of VRChat at the time this version of ComboGestureExpressions has been published.

At the time this version has been published, generating the layer will break your Lipsync blendshapes.", MessageType.Error);
            var helpBoxHeightReverse = 60;

            if (_lipsyncState.EditorLipsyncTool == 1)
            {
                _common.BeginLayoutUsing(position, CgeLayoutCommon.GuiSquareHeight * 8, helpBoxHeightReverse);
                LayoutLimitedLipsyncEditor(repaintCallback);
                CgeLayoutCommon.EndLayout();
            }
            else
            {
                GUILayout.Label("Select face expressions with a <b>wide open mouth</b>.", _common.LargeFont);
                GUILayout.BeginArea(new Rect(0, CgeLayoutCommon.SingleLineHeight * 3 + helpBoxHeightReverse, position.width, CgeLayoutCommon.GuiSquareHeight * 8));
                var allClips = new HashSet <AnimationClip>(_editorEffector.AllDistinctAnimations()).ToList();
                var mod      = Math.Max(3, Math.Min(8, (int)Math.Sqrt(allClips.Count)));
                for (var element = 0; element < allClips.Count; element++)
                {
                    GUILayout.BeginArea(CgeLayoutCommon.RectAt(element % mod, element / mod));
                    DrawLipsyncSwitch(allClips[element]);
                    GUILayout.EndArea();
                }
                GUILayout.EndArea();
                GUILayout.Box(
                    "",
                    GUIStyle.none,
                    GUILayout.Width(CgeLayoutCommon.GuiSquareHeight + CgeLayoutCommon.GuiSquareHeight * mod + CgeLayoutCommon.SingleLineHeight * 2),
                    GUILayout.Height(CgeLayoutCommon.GuiSquareHeight + CgeLayoutCommon.GuiSquareHeight * (allClips.Count / mod) + CgeLayoutCommon.SingleLineHeight * 2 + helpBoxHeightReverse)
                    );
            }
        }
Пример #2
0
        private void DrawBlinkingSwitch(AnimationClip element)
        {
            var isRegisteredAsBlinking = _editorEffector.BlinkingContains(element);

            if (isRegisteredAsBlinking)
            {
                CgeLayoutCommon.DrawColoredBackground(CgeLayoutCommon.RightSideBg);
            }
            GUILayout.BeginArea(new Rect((CgeLayoutCommon.GuiSquareWidth - CgeLayoutCommon.PictureWidth) / 2, 0, CgeLayoutCommon.PictureWidth, CgeLayoutCommon.PictureHeight));
            _common.DrawPreviewOrRefreshButton(element);
            GUILayout.EndArea();

            GUILayout.Space(CgeLayoutCommon.PictureHeight);
            EditorGUI.BeginDisabledGroup(true);
            EditorGUILayout.ObjectField(element, typeof(AnimationClip), true);
            EditorGUI.EndDisabledGroup();
            if (GUILayout.Button(isRegisteredAsBlinking ? CgeLocale.CGEE_EyesAreClosed : ""))
            {
                if (isRegisteredAsBlinking)
                {
                    _editorEffector.RemoveFromBlinking(element);
                }
                else
                {
                    _editorEffector.AddToBlinking(element);
                }
            }
        }
 public CgeLayoutMakeLipsyncMovementsSubtle(CgeLayoutCommon common, CgeActivityEditorDriver driver, CgeEditorEffector editorEffector, EeRenderingCommands renderingCommands)
 {
     _common            = common;
     _driver            = driver;
     _editorEffector    = editorEffector;
     _renderingCommands = renderingCommands;
 }
Пример #4
0
        public void Layout(Rect position)
        {
            var allClips = _editorEffector.AllDistinctAnimations();
            var mod      = Math.Max(3, Math.Min(8, (int)Math.Sqrt(allClips.Count)));

            var width  = CgeLayoutCommon.GuiSquareHeight + CgeLayoutCommon.GuiSquareHeight * mod + CgeLayoutCommon.SingleLineHeight * 2;
            var height = CgeLayoutCommon.GuiSquareHeight + CgeLayoutCommon.GuiSquareHeight * (allClips.Count / mod) + CgeLayoutCommon.SingleLineHeight * 2;

            _common.BeginLayoutUsingWidth(position, (int)height, 0, (int)width);
            GUILayout.Label(CgeLocale.CGEE_SelectFaceExpressionsWithBothEyesClosed, _common.LargeFont);
            GUILayout.BeginArea(new Rect(0, CgeLayoutCommon.SingleLineHeight * 3, position.width, CgeLayoutCommon.GuiSquareHeight * 8));
            for (var element = 0; element < allClips.Count; element++)
            {
                GUILayout.BeginArea(CgeLayoutCommon.RectAt(element % mod, element / mod));
                DrawBlinkingSwitch(allClips[element]);
                GUILayout.EndArea();
            }
            GUILayout.EndArea();
            GUILayout.Box(
                "",
                GUIStyle.none,
                GUILayout.Width(width),
                GUILayout.Height(height)
                );
            CgeLayoutCommon.EndLayout();
        }
 public CgeLayoutFaceExpressionCombiner(CgeLayoutCommon common, CgeActivityEditorDriver driver, CgeEditorEffector editorEffector, EeRenderingCommands renderingCommands, CgeActivityPreviewQueryAggregator activityPreviewQueryAggregator)
 {
     _common            = common;
     _driver            = driver;
     _editorEffector    = editorEffector;
     _renderingCommands = renderingCommands;
     _activityPreviewQueryAggregator = activityPreviewQueryAggregator;
 }
Пример #6
0
 public CgeLayoutSetFaceExpressions(CgeLayoutCommon common, CgeActivityEditorDriver driver, CgeLayoutFaceExpressionCombiner layoutFaceExpressionCombiner, CgeEditorEffector editorEffector, Action repaintCallback, CgeBlendTreeEffector blendTreeEffector)
 {
     _common = common;
     _driver = driver;
     _layoutFaceExpressionCombiner = layoutFaceExpressionCombiner;
     _editorEffector    = editorEffector;
     _repaintCallback   = repaintCallback;
     _blendTreeEffector = blendTreeEffector;
 }
Пример #7
0
        private void LayoutPermutationMatrixProjection(bool partial = false)
        {
            for (var sideA = 0; sideA < 8; sideA++)
            {
                for (var sideB = 0; sideB < 8; sideB++)
                {
                    GUILayout.BeginArea(RectAt(sideB, sideA));
                    DrawInner("anim" + sideA + "" + sideB, "anim" + sideB + "" + sideA, partial);
                    GUILayout.EndArea();
                }
            }
            for (var side = 1; side < 8; side++)
            {
                GUILayout.BeginArea(RectAt(8, side));
                DrawInner("anim0" + side, "anim" + side + "0", partial);
                GUILayout.EndArea();

                GUILayout.BeginArea(RectAt(side, 8));
                DrawInner("anim" + side + "0", "anim0" + side, partial);
                GUILayout.EndArea();
            }

            GUILayout.BeginArea(RectAt(0, 8));
            CgeLayoutCommon.DrawColoredBackground(CgeLayoutCommon.LeftSideBg);
            DrawInner("anim11_L");
            GUILayout.EndArea();
            GUILayout.BeginArea(RectAt(8, 0));
            CgeLayoutCommon.DrawColoredBackground(CgeLayoutCommon.RightSideBg);
            DrawInner("anim11_R");
            GUILayout.EndArea();

            GUILayout.BeginArea(RectAt(8, 8));
            DrawTransitionEdit();

            if (!GUILayout.Toggle(true, CgeLocale.CGEE_EnablePermutations, GUILayout.ExpandWidth(true), GUILayout.Height(CgeLayoutCommon.SingleLineHeight * 2)))
            {
                _editorEffector.SpEnablePermutations().boolValue = false;
                _editorEffector.SpEditorTool().intValue          = 4;
            }
            GUILayout.EndArea();
        }
Пример #8
0
        private void LayoutPermutationEditor(Rect position)
        {
            switch (_editorEffector.SpEditorTool().intValue)
            {
            case 0:
                BeginPermutationLayoutUsing(position);
                LayoutPermutationMatrixProjection(true);
                CgeLayoutCommon.EndLayout();
                break;

            case 2:
                LayoutAllPermutationTogglePage();
                break;

            case 1:
            default:
                BeginPermutationLayoutUsing(position);
                LayoutPermutationMatrixProjection();
                CgeLayoutCommon.EndLayout();
                break;
            }
        }
Пример #9
0
        private void LayoutActivityEditor(Rect position)
        {
            switch (_editorEffector.SpEditorTool().intValue)
            {
            case 1:
                BeginLayoutUsing(CgeLayoutCommon.GuiSquareHeight * 2, position);
                LayoutSinglesDoublesMatrixProjection();
                CgeLayoutCommon.EndLayout();
                break;

            case 2:
                BeginLayoutUsing(CgeLayoutCommon.GuiSquareHeight * 5, position);
                LayoutFistMatrixProjection();
                CgeLayoutCommon.EndLayout();
                break;

            case 3:
                BeginLayoutUsing(CgeLayoutCommon.GuiSquareHeight * 8, position);
                LayoutComboMatrixProjection();
                CgeLayoutCommon.EndLayout();
                break;

            case 4:
                LayoutAllPermutationTogglePage();
                break;

            case 5:
                LayoutAllOneHandModePage();
                break;

            default:
                BeginLayoutUsing(CgeLayoutCommon.GuiSquareHeight * 8, position);
                LayoutFullMatrixProjection();
                CgeLayoutCommon.EndLayout();
                break;
            }
        }
Пример #10
0
 private void LayoutOneHandEditor(Rect position)
 {
     BeginLayoutUsing(CgeLayoutCommon.GuiSquareHeight * 4, position);
     LayoutOneHandMode();
     CgeLayoutCommon.EndLayout();
 }
Пример #11
0
        private void DrawInner(string propertyPath, string oppositePath = null, bool partial = false)
        {
            var usePermutations  = oppositePath != null;
            var property         = _editorEffector.SpProperty(propertyPath);
            var oppositeProperty = usePermutations ? _editorEffector.SpProperty(oppositePath) : null;
            var isLeftHand       = String.Compare(propertyPath, oppositePath, StringComparison.Ordinal) > 0;

            if (usePermutations)
            {
                if (propertyPath == oppositePath)
                {
                    CgeLayoutCommon.DrawColoredBackground(CgeLayoutCommon.NeutralSideBg);
                }
                else if (property.objectReferenceValue == null && oppositeProperty.objectReferenceValue == null ||
                         isLeftHand && property.objectReferenceValue == null && oppositeProperty.objectReferenceValue != null ||
                         !isLeftHand && property.objectReferenceValue != null && oppositeProperty.objectReferenceValue == null)
                {
                    if (isLeftHand && partial)
                    {
                        return;
                    }

                    CgeLayoutCommon.DrawColoredBackground(isLeftHand ? CgeLayoutCommon.LeftSymmetricalBg : CgeLayoutCommon.RightSymmetricalBg);
                }
                else if (oppositeProperty.objectReferenceValue == property.objectReferenceValue || isLeftHand && oppositeProperty.objectReferenceValue == null || !isLeftHand && property.objectReferenceValue == null)
                {
                    CgeLayoutCommon.DrawColoredBackground(CgeLayoutCommon.InconsistentBg);
                }
                else
                {
                    CgeLayoutCommon.DrawColoredBackground(isLeftHand ? CgeLayoutCommon.LeftSideBg : CgeLayoutCommon.RightSideBg);
                }
            }

            var translatableProperty = usePermutations
                ? (partial && !isLeftHand && oppositeProperty.objectReferenceValue == null ? propertyPath : ("p_" + propertyPath))
                : propertyPath;
            var isSymmetrical = _driver.IsSymmetrical(translatableProperty);

            if (!usePermutations)
            {
                CgeLayoutCommon.DrawColoredBackground(CgeLayoutCommon.NeutralSideBg);
            }

            GUILayout.Label(_driver.ShortTranslation(translatableProperty), isSymmetrical ? _common.MiddleAlignedBold : _common.MiddleAligned);

            var element = property.objectReferenceValue != null ? (Motion)property.objectReferenceValue : null;

            if (element != null)
            {
                GUILayout.BeginArea(new Rect((CgeLayoutCommon.GuiSquareWidth - CgeLayoutCommon.PictureWidth) / 2, CgeLayoutCommon.SingleLineHeight, CgeLayoutCommon.PictureWidth, CgeLayoutCommon.PictureHeight));
                _common.DrawPreviewOrRefreshButton(element);
                GUILayout.EndArea();
            }
            else if (usePermutations)
            {
                if (oppositeProperty.objectReferenceValue != null && propertyPath != oppositePath && isLeftHand)
                {
                    DrawInnerReversal(oppositePath);
                }
            }
            else
            {
                // ReSharper disable once PossibleLossOfFraction
                GUILayout.BeginArea(new Rect((CgeLayoutCommon.GuiSquareWidth - CgeLayoutCommon.PictureWidth) / 2, CgeLayoutCommon.SingleLineHeight, CgeLayoutCommon.PictureWidth, CgeLayoutCommon.PictureHeight));
                GUILayout.EndArea();
            }


            if (_driver.IsAPropertyThatCanBeCombined(propertyPath, usePermutations) && !(element is BlendTree))
            {
                var rect = element is AnimationClip
                    ? new Rect(-3 + CgeLayoutCommon.GuiSquareWidth - 2 * CgeLayoutCommon.SingleLineHeight, CgeLayoutCommon.PictureHeight - CgeLayoutCommon.SingleLineHeight * 0.5f, CgeLayoutCommon.SingleLineHeight * 2, CgeLayoutCommon.SingleLineHeight * 1.5f)
                    : new Rect(-3 + CgeLayoutCommon.GuiSquareWidth - 100, CgeLayoutCommon.PictureHeight - CgeLayoutCommon.SingleLineHeight * 0.5f, 100, CgeLayoutCommon.SingleLineHeight * 1.5f);

                var areSourcesCompatible = _driver.AreCombinationSourcesDefinedAndCompatible(propertyPath, usePermutations);
                EditorGUI.BeginDisabledGroup(!areSourcesCompatible);
                GUILayout.BeginArea(rect);
                if (ColoredBackground(usePermutations, isLeftHand ? CgeLayoutCommon.LeftSideBg : CgeLayoutCommon.RightSideBg, () => GUILayout.Button((element != null ? "+" : "+ " + CgeLocale.CGEE_Combine))))
                {
                    var merge = _driver.ProvideCombinationPropertySources(propertyPath, usePermutations);
                    OpenMergeWindowFor(merge.Left, merge.Right, propertyPath, usePermutations);
                }
                GUILayout.EndArea();
                EditorGUI.EndDisabledGroup();
            }
            else if (element is BlendTree)
            {
                var rect = new Rect(-3 + CgeLayoutCommon.GuiSquareWidth - 20, CgeLayoutCommon.PictureHeight - CgeLayoutCommon.SingleLineHeight * 0.5f, 20, CgeLayoutCommon.SingleLineHeight * 1.5f);

                EditorGUI.BeginDisabledGroup(false);
                GUILayout.BeginArea(rect);
                if (GUILayout.Button("?"))
                {
                    OpenBlendTreeAt(propertyPath);
                }
                GUILayout.EndArea();
                EditorGUI.EndDisabledGroup();
            }
            else
            {
                BeginInvisibleRankPreservingArea();
                CgeLayoutCommon.InvisibleRankPreservingButton();
                EndInvisibleRankPreservingArea();
            }

            if (_driver.IsAPropertyThatCanBeCombinedDiagonally(propertyPath, usePermutations) && !(element is BlendTree))
            {
                var rect = !_driver.IsSymmetrical(propertyPath) || element != null
                    ? new Rect(0, CgeLayoutCommon.PictureHeight - CgeLayoutCommon.SingleLineHeight * 0.5f, CgeLayoutCommon.SingleLineHeight * 2, CgeLayoutCommon.SingleLineHeight * 1.5f)
                    : new Rect(0, CgeLayoutCommon.PictureHeight - CgeLayoutCommon.SingleLineHeight * 0.5f, 120, CgeLayoutCommon.SingleLineHeight * 1.5f);

                var areSourcesCompatible = _driver.AreDiagonalCombinationSourcesDefinedAndCompatible(propertyPath, usePermutations);
                EditorGUI.BeginDisabledGroup(!areSourcesCompatible);
                GUILayout.BeginArea(rect);
                if (ColoredBackground(!isSymmetrical, !isLeftHand ? CgeLayoutCommon.LeftSideBg : CgeLayoutCommon.RightSideBg, () => GUILayout.Button(!_driver.IsSymmetrical(propertyPath) || element != null ? "⅃" : "⅃ " + CgeLocale.CGEE_CombineAcross)))
                {
                    var merge = _driver.ProvideDiagonalCombinationPropertySources(propertyPath, usePermutations);
                    OpenMergeWindowFor(merge.Left, merge.Right, propertyPath, usePermutations);
                }
                GUILayout.EndArea();
                EditorGUI.EndDisabledGroup();
            }

            if (element == null && !_driver.IsAPropertyThatCanBeCombined(propertyPath, usePermutations))
            {
                EditorGUI.BeginDisabledGroup(false);
                GUILayout.BeginArea(new Rect(-3 + 10, CgeLayoutCommon.PictureHeight - CgeLayoutCommon.SingleLineHeight * 3f, CgeLayoutCommon.GuiSquareWidth - 20, CgeLayoutCommon.SingleLineHeight * 1.5f));
                if (GUILayout.Button("❈ " + CgeLocale.CGEE_Create))
                {
                    CreateNewAnimation(propertyPath);
                }
                GUILayout.EndArea();
                EditorGUI.EndDisabledGroup();
            }

            if (usePermutations && propertyPath != oppositePath && property.objectReferenceValue == oppositeProperty.objectReferenceValue && property.objectReferenceValue != null)
            {
                EditorGUI.BeginDisabledGroup(false);
                GUILayout.BeginArea(new Rect(-3 + 10, CgeLayoutCommon.PictureHeight - CgeLayoutCommon.SingleLineHeight * 1.75f, CgeLayoutCommon.GuiSquareWidth - 10, CgeLayoutCommon.SingleLineHeight * 1.5f));
                if (GUILayout.Button("↗↗ " + CgeLocale.CGEE_Simplify))
                {
                    Simplify(isLeftHand ? propertyPath : oppositePath);
                }
                GUILayout.EndArea();
                EditorGUI.EndDisabledGroup();
            }
            else if (usePermutations && (isLeftHand && property.objectReferenceValue != null && oppositeProperty.objectReferenceValue == null || !isLeftHand && property.objectReferenceValue == null && oppositeProperty.objectReferenceValue != null))
            {
                EditorGUI.BeginDisabledGroup(false);
                GUILayout.BeginArea(new Rect(-3 + 10, CgeLayoutCommon.PictureHeight - CgeLayoutCommon.SingleLineHeight * 1.75f, CgeLayoutCommon.GuiSquareWidth - 10, CgeLayoutCommon.SingleLineHeight * 1.5f));
                if (GUILayout.Button("↗↙ " + CgeLocale.CGEE_SwapToFix))
                {
                    Swap(propertyPath, oppositePath);
                }
                GUILayout.EndArea();
                EditorGUI.EndDisabledGroup();
            }
            else if (usePermutations && isLeftHand && property.objectReferenceValue != null)
            {
                EditorGUI.BeginDisabledGroup(false);
                GUILayout.BeginArea(new Rect(-3 + CgeLayoutCommon.GuiSquareWidth - 2 * CgeLayoutCommon.SingleLineHeight, CgeLayoutCommon.PictureHeight - CgeLayoutCommon.SingleLineHeight * 1.75f, 2 * CgeLayoutCommon.SingleLineHeight, CgeLayoutCommon.SingleLineHeight * 1.5f));
                if (GUILayout.Button("↗↙"))
                {
                    Swap(propertyPath, oppositePath);
                }
                GUILayout.EndArea();
                EditorGUI.EndDisabledGroup();
            }
            else if (element == null && _driver.IsAutoSettable(propertyPath))
            {
                var propertyPathToCopyFrom = _driver.GetAutoSettableSource(propertyPath);
                var animationToBeCopied    = _editorEffector.SpProperty(propertyPathToCopyFrom).objectReferenceValue;

                EditorGUI.BeginDisabledGroup(animationToBeCopied == null);
                GUILayout.BeginArea(new Rect(-3 + CgeLayoutCommon.GuiSquareWidth - 100, CgeLayoutCommon.PictureHeight - CgeLayoutCommon.SingleLineHeight * 1.75f, 100, CgeLayoutCommon.SingleLineHeight * 1.5f));
                if (GUILayout.Button(CgeLocale.CGEE_AutoSet))
                {
                    AutoSet(propertyPath, propertyPathToCopyFrom);
                }
                GUILayout.EndArea();
                EditorGUI.EndDisabledGroup();
            }
            else if (element == null && _driver.AreCombinationSourcesIdentical(propertyPath))
            {
                var propertyPathToCopyFrom = _driver.ProvideCombinationPropertySources(propertyPath, usePermutations).Left;
                var animationToBeCopied    = _editorEffector.SpProperty(propertyPathToCopyFrom).objectReferenceValue;

                EditorGUI.BeginDisabledGroup(animationToBeCopied == null);
                GUILayout.BeginArea(new Rect(-3 + CgeLayoutCommon.GuiSquareWidth - 100, CgeLayoutCommon.PictureHeight - CgeLayoutCommon.SingleLineHeight * 1.75f, 100, CgeLayoutCommon.SingleLineHeight * 1.5f));
                if (GUILayout.Button(CgeLocale.CGEE_AutoSet))
                {
                    AutoSet(propertyPath, propertyPathToCopyFrom);
                }
                GUILayout.EndArea();
                EditorGUI.EndDisabledGroup();
            }
            else
            {
                BeginInvisibleRankPreservingArea();
                CgeLayoutCommon.InvisibleRankPreservingButton();
                EndInvisibleRankPreservingArea();
            }

            GUILayout.Space(CgeLayoutCommon.PictureHeight);
            EditorGUILayout.PropertyField(property, GUIContent.none);
        }
 public CgeLayoutManipulateTrees(CgeLayoutCommon common, CgeEditorEffector editorEffector, CgeBlendTreeEffector blendTreeEffector)
 {
     _common            = common;
     _editorEffector    = editorEffector;
     _blendTreeEffector = blendTreeEffector;
 }
        public void Layout(Action repaintCallback, Rect position)
        {
            _common.BeginLayoutUsingWidth(position, CgeLayoutCommon.GuiSquareHeight * 2, 0, CgeLayoutCommon.GuiSquareWidth * 4);
            if (_editorEffector.IsFirstTimeSetup() || !_editorEffector.IsPreviewSetupValid())
            {
                if (_editorEffector.HasPreviewSetupWhichIsInvalid())
                {
                    EditorGUILayout.LabelField(CgeLocale.CGEE_IncompletePreviewSetup);
                }

                EditorGUILayout.PropertyField(_editorEffector.SpPreviewSetup(), new GUIContent(CgeLocale.CGEE_Preview_setup));
                GUILayout.Space(15);
                GUILayout.BeginHorizontal();
                GUILayout.FlexibleSpace();
                if (GUILayout.Button(CgeLocale.CGEE_Automatically_setup_preview, GUILayout.Height(50), GUILayout.Width(300)))
                {
                    DoAutoSetupPreview();
                    if (_editorEffector.GetSetupResult() != EePreviewSetupWizard.SetupResult.NoAvatarFound)
                    {
                        _editorEffector.SwitchTo(ActivityEditorMode.SetFaceExpressions);
                    }
                }
                GUILayout.FlexibleSpace();
                GUILayout.EndHorizontal();
            }
            else
            {
                EditorGUILayout.PropertyField(_editorEffector.SpTransitionDuration(), new GUIContent(CgeLocale.CGEE_Transition_duration));
                EditorGUILayout.PropertyField(_editorEffector.SpPreviewSetup(), new GUIContent(CgeLocale.CGEE_Preview_setup));
                if (_editorEffector.GetSetupResult() != null)
                {
                    var setupResult = (EePreviewSetupWizard.SetupResult)_editorEffector.GetSetupResult();
                    switch (setupResult)
                    {
                    case EePreviewSetupWizard.SetupResult.ReusedExistsAndValidInScene:
                        EditorGUILayout.HelpBox(CgeLocale.CGEE_AutoSetupReused, MessageType.Info);
                        break;

                    case EePreviewSetupWizard.SetupResult.NoAvatarFound:
                        EditorGUILayout.HelpBox(CgeLocale.CGEE_AutoSetupNoActiveAvatarDescriptor, MessageType.Error);
                        break;

                    case EePreviewSetupWizard.SetupResult.CreatedNew:
                        EditorGUILayout.HelpBox(CgeLocale.CGEE_AutoSetupCreated, MessageType.Info);
                        break;

                    default:
                        throw new ArgumentOutOfRangeException();
                    }
                }

                EditorGUI.BeginDisabledGroup(AnimationMode.InAnimationMode());
                if (GUILayout.Button(CgeLocale.CGEE_Generate_missing_previews))
                {
                    _activityPreviewQueryAggregator.GenerateMissingPreviews(repaintCallback);
                }

                if (GUILayout.Button(CgeLocale.CGEE_Regenerate_all_previews))
                {
                    _activityPreviewQueryAggregator.GenerateAll(repaintCallback);
                }
                if (_editorEffector.GetCurrentlyEditing() == CurrentlyEditing.Activity)
                {
                    EditorGUILayout.PropertyField(_editorEffector.SpEditorArbitraryAnimations(), new GUIContent(CgeLocale.CGEE_List_of_arbitrary_animations), true);
                }
                EditorGUI.EndDisabledGroup();

                EditorGUI.BeginDisabledGroup(!AnimationMode.InAnimationMode());
                EditorGUI.EndDisabledGroup();

                if (_editorEffector.GetCurrentlyEditing() == CurrentlyEditing.Activity)
                {
                    if (_editorEffector.GetActivity().editorArbitraryAnimations != null)
                    {
                        GUILayout.BeginArea(new Rect(0, CgeLayoutCommon.SingleLineHeight * 10, position.width, CgeLayoutCommon.GuiSquareHeight * 8));
                        var allClips = new HashSet <AnimationClip>(_editorEffector.GetActivity().editorArbitraryAnimations.Where(clip => clip != null)).ToList();
                        var mod      = (int)Math.Max(1, position.width / CgeLayoutCommon.GuiSquareWidth);
                        for (var element = 0; element < allClips.Count; element++)
                        {
                            GUILayout.BeginArea(CgeLayoutCommon.RectAt(element % mod, element / mod));
                            DrawArbitrary(allClips[element]);
                            GUILayout.EndArea();
                        }

                        GUILayout.EndArea();
                        GUILayout.Space((allClips.Count / mod) * CgeLayoutCommon.GuiSquareHeight + CgeLayoutCommon.GuiSquareHeight + CgeLayoutCommon.SingleLineHeight * 2);
                    }
                }
            }
            CgeLayoutCommon.EndLayout();
        }
 public CgeLayoutOtherOptions(CgeLayoutCommon common, CgeEditorEffector editorEffector, CgeActivityPreviewQueryAggregator activityPreviewQueryAggregator)
 {
     _common         = common;
     _editorEffector = editorEffector;
     _activityPreviewQueryAggregator = activityPreviewQueryAggregator;
 }
Пример #15
0
 public CgeLayoutPreventEyesBlinking(CgeLayoutCommon common, CgeEditorEffector editorEffector)
 {
     _common         = common;
     _editorEffector = editorEffector;
 }