Ejemplo n.º 1
0
        static public void Show(List <string> right, List <string> wrong)
        {
            EditorWindow_FBAniCheck_SubCompare.right = right;
            EditorWindow_FBAniCheck_SubCompare.wrong = wrong;

            if (_win == null)
            {
                _win = new EditorWindow_FBAniCheck_SubCompare();
                _win.Show();
            }
        }
Ejemplo n.º 2
0
        private void OnGUI()
        {
            if (popList == null)
            {
                popList = new List <string>();

                foreach (var c in ani.Clips)
                {
                    popList.Add(c.name);
                }

                lastSelect = popList.FindIndex((s) => s.Contains("idle."));
                if (lastSelect < 0)
                {
                    lastSelect = 0;
                }

                SeachAllBones(popList[lastSelect]);
            }
            else if (calcMap.Count == 0)
            {
                SeachAllBones(popList[lastSelect]);
            }

            var last = lastSelect;

            GUILayout.Label("请选择基准骨骼动作(一般为idle)");
            lastSelect = EditorGUILayout.Popup(lastSelect, popList.ToArray(), GUILayout.Width(150));
            if (lastSelect != last)
            {
                SeachAllBones(popList[lastSelect]);
            }


            pos = GUILayout.BeginScrollView(pos);
            {
                foreach (var item in calcMap)
                {
                    var ret = item.Value;
                    GUI.color = Color.green;
                    GUILayout.Label("clip:" + item.Key);
                    GUI.color = GUI.contentColor;
                    GUILayout.Label(ret.info);

                    GUILayout.Label("检测结果:");
                    if (ret.errorBones.Count == 0)
                    {
                        GUI.color = Color.green;
                        GUILayout.Label("通过检测");
                        GUI.color = GUI.contentColor;
                    }
                    else
                    {
                        GUI.color = Color.red;
                        GUILayout.Label("错误骨骼开始于(默认显示前10组):");
                        GUILayout.Label("异常数:" + ret.errorBones.Count);
                        GUI.color = GUI.contentColor;
                        var count = Mathf.Min(20, ret.errorBones.Count);

                        if (GUILayout.Button(">>", GUILayout.Width(30)))
                        {
                            var wrong = ani.Clips.Find((c) => c.name == item.Key).boneinfo;
                            EditorWindow_FBAniCheck_SubCompare.Show(allBones, wrong);
                        }
                        for (int i = 0; i < count; i += 2)
                        {
                            GUILayout.Label(string.Format("第{0}对:", i / 2 + 1));
                            GUILayout.Label("正确骨骼:" + ret.errorBones[i]);
                            GUILayout.Label("动作骨骼:" + ret.errorBones[i + 1]);
                            GUILayout.Space(2);
                        }
                    }
                    GUILayout.Label("匹配骨骼情况:");

                    if (ret.notExsitBones.Count == 0)
                    {
                        GUI.color = Color.green;
                        GUILayout.Label("通过检测");
                        GUI.color = GUI.contentColor;
                    }
                    else
                    {
                        GUI.color = Color.red;
                        GUILayout.Label("模型中无下列骨骼:");
                        GUILayout.Label("异常数:" + ret.notExsitBones.Count);
                        GUI.color = GUI.contentColor;

                        var count = Mathf.Min(20, ret.notExsitBones.Count);
                        for (int i = 0; i < count; i++)
                        {
                            GUILayout.Label("骨骼:" + ret.notExsitBones[i]);
                            GUILayout.Space(2);
                        }
                    }

                    DrawLineH(Color.white);
                }
            }
            GUILayout.EndScrollView();
        }