コード例 #1
0
        public void Draw(List <SkillHsmConfigHSMParameter> parameterList)
        {
            EditorGUILayout.BeginHorizontal();
            {
                EditorGUILayout.LabelField("全部变量");
                GUILayout.Space(50);
                if (GUILayout.Button("导入变量"))
                {
                    HSMFileHandle.ImportParameter();
                }
            }
            EditorGUILayout.EndHorizontal();

            EditorGUILayout.BeginVertical("box", GUILayout.ExpandWidth(true));
            {
                EditorGUILayout.LabelField("条件参数");
                scrollPos = EditorGUILayout.BeginScrollView(scrollPos, GUILayout.ExpandHeight(true));
                {
                    GUI.backgroundColor = new Color(0.85f, 0.85f, 0.85f, 1f);
                    for (int i = 0; i < parameterList.Count; ++i)
                    {
                        SkillHsmConfigHSMParameter hsmParameter = parameterList[i];

                        Action DelCallBack = () =>
                        {
                            if (null != HSMManager.hSMNodeAddDelParameter)
                            {
                                HSMManager.parameterChange(hsmParameter, false);
                            }
                        };

                        EditorGUILayout.BeginVertical("box");
                        {
                            hsmParameter = HSMDrawParameter.Draw(hsmParameter, HSMDrawParameterType.HSM_PARAMETER, DelCallBack);
                        }
                        EditorGUILayout.EndVertical();
                    }
                    GUI.backgroundColor = Color.white;
                }
                EditorGUILayout.EndScrollView();
            }
            EditorGUILayout.EndVertical();

            GUILayout.Space(10);
            EditorGUILayout.BeginVertical("box");
            {
                DrawAddParameter();
            }
            EditorGUILayout.EndVertical();
        }
コード例 #2
0
        public void Draw()
        {
            EditorGUILayout.BeginVertical("box");
            {
                EditorGUILayout.BeginHorizontal();
                {
                    if (GUILayout.Button("选择文件"))
                    {
                        HSMFileHandle.SelectFile(HSMManager.Instance.FilePath);
                    }

                    if (GUILayout.Button("保存"))
                    {
                        HSMFileHandle.CreateSaveFile(HSMManager.Instance.FileName);
                        AssetDatabase.Refresh();
                    }

                    if (GUILayout.Button("删除"))
                    {
                        HSMFileHandle.DeleteFile(HSMManager.Instance.FileName);
                        AssetDatabase.Refresh();
                    }

                    if (GUILayout.Button("批量更新"))
                    {
                        HSMFileHandle.UpdateAllFile(HSMManager.Instance.FilePath);
                        AssetDatabase.Refresh();
                    }

                    if (GUILayout.Button("批量合并"))
                    {
                        HSMFileHandle.BeatchMergeAllFile();
                        AssetDatabase.Refresh();
                    }
                }
                EditorGUILayout.EndHorizontal();
                GUILayout.Space(5);

                EditorGUILayout.BeginHorizontal();
                {
                    EditorGUILayout.LabelField("文件名", GUILayout.Width(80));
                    HSMManager.Instance.FileName = EditorGUILayout.TextField(HSMManager.Instance.FileName);
                }
                EditorGUILayout.EndHorizontal();
                GUILayout.Space(5);
            }
            EditorGUILayout.EndVertical();
        }