Ejemplo n.º 1
0
        private void SubTreeNode(NodeValue nodeValue)
        {
            nodeValue.subTreeValue = EditorGUILayout.LongField("SubTreeValue:", nodeValue.subTreeValue);
            string[] nameArr = EnumNames.GetEnumNames <SUB_TREE_TYPE>();
            int      index   = EnumNames.GetEnumIndex <SUB_TREE_TYPE>((SUB_TREE_TYPE)nodeValue.subTreeType);
            int      result  = EditorGUILayout.Popup(new GUIContent("子树类型"), index, nameArr);

            nodeValue.subTreeType = (int)(EnumNames.GetEnum <SUB_TREE_TYPE>(result));

            GUILayout.Space(8);
            nodeValue.subTreeConfig = EditorGUILayout.TextField(new GUIContent("配置文件"), nodeValue.subTreeConfig);
            GUILayout.Space(5);

            if (nodeValue.subTreeType == (int)SUB_TREE_TYPE.CONFIG)
            {
                if (null != BehaviorManager.behaviorDeleteSubTreeChild)
                {
                    BehaviorManager.behaviorDeleteSubTreeChild(nodeValue.id);
                }

                if (GUILayout.Button("选择子树配置文件"))
                {
                    if (null != BehaviorManager.behaviorSelectFile)
                    {
                        nodeValue.subTreeConfig = BehaviorManager.behaviorSelectFile();
                    }
                }
            }
            else
            {
                if (GUILayout.Button("将子树存储为配置文件"))
                {
                    if (null != BehaviorManager.behaviorSaveSubTree)
                    {
                        BehaviorManager.behaviorSaveSubTree(nodeValue.subTreeConfig, nodeValue.id);
                    }
                }
            }
        }