private void SectionOptionsLeftMenu()
        {
            bool result;

            GUILayout.BeginVertical();

            // Selecting Not Looking for new pose section
            result = selectedSectionType == SectionSelectedType.NotLookingForNewPoseSection;
            if (GUILayoutElements.DrawHeader(
                    "NotLookingForNewPose",
                    GUIResources.GetLightHeaderStyle_MD(),
                    GUIResources.GetDarkHeaderStyle_MD(),
                    result
                    ))
            {
                selectedSectionType  = SectionSelectedType.NotLookingForNewPoseSection;
                selectedSectionIndex = -1;
            }
            GUILayout.Space(betweenSectionsSpace);
            // Selecting Never Looking for new pose section
            result = selectedSectionType == SectionSelectedType.NeverLookingForNewPoseSection;
            if (GUILayoutElements.DrawHeader(
                    "NeverChecking",
                    GUIResources.GetLightHeaderStyle_MD(),
                    GUIResources.GetDarkHeaderStyle_MD(),
                    result
                    ))
            {
                selectedSectionType  = SectionSelectedType.NeverLookingForNewPoseSection;
                selectedSectionIndex = -1;
            }
            GUILayout.Space(betweenSectionsSpace);
            // Selecting other sections
            result = selectedSectionType == SectionSelectedType.NormalSection;

            for (int i = 0; i < editedData.sections.Count; i++)
            {
                if (GUILayoutElements.DrawHeader(
                        editedData.sections[i].sectionName,
                        GUIResources.GetLightHeaderStyle_MD(),
                        GUIResources.GetDarkHeaderStyle_MD(),
                        result && i == selectedSectionIndex
                        ))
                {
                    selectedSectionType  = SectionSelectedType.NormalSection;
                    selectedSectionIndex = i;
                }
                GUILayout.Space(betweenSectionsSpace);
            }
            GUILayout.EndVertical();
        }
        public static void DrawOptions(DataCreator creator)
        {
            float space = 5f;

            GUILayout.Space(space);
            GUILayoutElements.DrawHeader(
                "Options",
                GUIResources.GetLightHeaderStyle_MD(),
                GUIResources.GetDarkHeaderStyle_MD(),
                ref creator.basicOptionFold
                );
            if (creator.basicOptionFold)
            {
                DrawBasicOptions(creator);
            }

            GUILayout.Space(space);
            GUILayoutElements.DrawHeader(
                "Bones used to motion matching",
                GUIResources.GetLightHeaderStyle_MD(),
                GUIResources.GetDarkHeaderStyle_MD(),
                ref creator.maskFold
                );

            if (creator.maskFold)
            {
                DrawNeededBones(creator);
            }

            GUILayout.Space(space);
            GUILayoutElements.DrawHeader(
                "Trajectory Times",
                GUIResources.GetLightHeaderStyle_MD(),
                GUIResources.GetDarkHeaderStyle_MD(),
                ref creator.trajectoryFold
                );

            if (creator.trajectoryFold)
            {
                DrawTrajectoryTimes(creator);
            }
        }
Exemple #3
0
        public static void DrawTreesList(DataCreator creator, EditorWindow editor)
        {
            GUILayoutElements.DrawHeader("Blend Trees", GUIResources.GetDarkHeaderStyle_MD());

            GUILayout.BeginHorizontal();
            if (GUILayout.Button("Add"))
            {
                creator.blendTrees.Add(new BlendTreeInfo("New info"));
            }
            //if (GUILayout.Button("Clear"))
            //{
            //    creator.blendTrees.Clear();
            //}
            GUILayout.EndHorizontal();
            GUILayout.Space(5);

            GUILayout.BeginHorizontal();
            GUILayout.Label("Find", GUILayout.Width(50));
            creator.findingBlendTree = GUILayout.TextField(creator.findingBlendTree);
            GUILayout.EndHorizontal();

            GUILayout.Space(5);

            for (int i = 0; i < creator.blendTrees.Count; i++)
            {
                if (creator.findingBlendTree != "" && !creator.blendTrees[i].name.ToLower().Contains(creator.findingBlendTree.ToLower()))
                {
                    continue;
                }

                GUILayout.BeginHorizontal();
                GUILayout.Space(5);
                GUILayout.Label(
                    creator.blendTrees[i].name,
                    i == creator.selectedBlendTree ? GUIResources.GetDarkHeaderStyle_SM() : GUIResources.GetLightHeaderStyle_SM()
                    );


                Event e = Event.current;
                Rect  r = GUILayoutUtility.GetLastRect();

                if (r.Contains(e.mousePosition) && e.type == EventType.MouseDown && e.button == 0)
                {
                    if (creator.selectedBlendTree == i)
                    {
                        creator.selectedBlendTree = -1;
                    }
                    else
                    {
                        creator.selectedBlendTree = i;
                    }
                    e.Use();
                    editor.Repaint();
                }

                if (GUILayout.Button("Copy", GUILayout.Width(40)))
                {
                    creator.blendTrees.Add(new BlendTreeInfo(creator.blendTrees[i].name + "_NEW"));
                    for (int j = 0; j < creator.blendTrees[i].clips.Count; j++)
                    {
                        creator.blendTrees[creator.blendTrees.Count - 1].AddClip(creator.blendTrees[i].clips[j]);
                    }
                }

                if (GUILayout.Button("X", GUILayout.Width(25)))
                {
                    creator.blendTrees.RemoveAt(i);
                    i--;
                }
                GUILayout.EndHorizontal();
                GUILayout.Space(5);
            }
            GUILayout.Space(5);
        }
        public static void DrawSequencesList(DataCreator creator, EditorWindow editor)
        {
            GUILayoutElements.DrawHeader("Sequences", GUIResources.GetDarkHeaderStyle_MD());

            GUILayout.BeginHorizontal();
            if (GUILayout.Button("Add"))
            {
                creator.sequences.Add(new AnimationsSequence("new Sequence"));
            }
            //if (GUILayout.Button("Clear"))
            //{
            //    creator.sequences.Clear();
            //}
            GUILayout.EndHorizontal();
            GUILayout.Space(5);

            GUILayout.BeginHorizontal();
            GUILayout.Label("Find", GUILayout.Width(50));
            creator.findingSequence = EditorGUILayout.TextField(creator.findingSequence);
            GUILayout.EndHorizontal();

            GUILayout.Space(5);

            for (int i = 0; i < creator.sequences.Count; i++)
            {
                if (creator.findingSequence != "" && !creator.sequences[i].name.ToLower().Contains(creator.findingSequence.ToLower()))
                {
                    continue;
                }
                GUILayout.BeginHorizontal();
                GUILayout.Space(5);
                GUILayout.Label(
                    creator.sequences[i].name,
                    i == creator.selectedSequence ? GUIResources.GetDarkHeaderStyle_SM() : GUIResources.GetLightHeaderStyle_SM()
                    );


                Event e = Event.current;
                Rect  r = GUILayoutUtility.GetLastRect();

                if (r.Contains(e.mousePosition) && e.type == EventType.MouseDown && e.button == 0)
                {
                    if (creator.selectedSequence == i)
                    {
                        creator.selectedSequence = -1;
                    }
                    else
                    {
                        creator.selectedSequence = i;
                    }
                    e.Use();
                    editor.Repaint();
                }

                if (GUILayout.Button("Copy", GUILayout.Width(40)))
                {
                    AnimationsSequence info = new AnimationsSequence(creator.sequences[i].name + "_New");

                    for (int j = 0; j < creator.sequences[i].clips.Count; j++)
                    {
                        info.clips.Add(creator.sequences[i].clips[j]);
                        info.neededInfo.Add(creator.sequences[i].neededInfo[j]);
                        info.findPoseInClip.Add(creator.sequences[i].findPoseInClip[j]);
                    }

                    creator.sequences.Insert(i + 1, info);
                }
                if (GUILayout.Button("X", GUILayout.Width(25)))
                {
                    creator.sequences.RemoveAt(i);
                    i--;
                }
                GUILayout.Space(10);
                GUILayout.EndHorizontal();
                GUILayout.Space(5);
            }
            GUILayout.Space(5);
        }