protected override void Common1()
        {
            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));
            nodeValue.subTreeConfig = EditorGUILayout.TextField(new GUIContent("配置文件"), nodeValue.subTreeConfig);
            GUILayout.Space(5);

            if (nodeValue.subTreeType == (int)SUB_TREE_TYPE.CONFIG)
            {
                DataHandler dataHandler = new DataHandler();
                dataHandler.DeleteSubTreeChild(nodeValue.id);

                if (GUILayout.Button("选择子树配置文件"))
                {
                    ConfigFileSelect configFileSelect = new ConfigFileSelect();
                    nodeValue.subTreeConfig = configFileSelect.Select();
                }
            }
            else
            {
                if (GUILayout.Button("将子树存储为配置文件"))
                {
                    ConfigFileSaveSubTree configFileSaveSubTree = new ConfigFileSaveSubTree();
                    configFileSaveSubTree.SaveSubTree(nodeValue.subTreeConfig, nodeValue.id);
                }
            }
        }
Exemplo n.º 2
0
        private void SelectFile()
        {
            ConfigFileSelect configFileSelect = new ConfigFileSelect();
            string           filePath         = configFileSelect.Select();

            if (string.IsNullOrEmpty(filePath))
            {
                return;
            }
            string         fileName       = System.IO.Path.GetFileNameWithoutExtension(filePath);
            ConfigFileLoad configFileLoad = new ConfigFileLoad();

            configFileLoad.LoadFile(fileName);
        }