少年修仙传客户端基础资源
lwb
2020-10-15 212ae4b4a130a8983d915936a9e70d5ae616a438
8540 【工具】指引提取语言表工具
1个文件已修改
2个文件已添加
56 ■■■■■ 已修改文件
Assets/Editor/ScriptEditor/NewBieGuideEditorWindow.cs 补丁 | 查看 | 原始文档 | blame | 历史
Assets/Editor/Tool/ExportGuides.cs 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Assets/Editor/Tool/ExportGuides.cs.meta 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Assets/Editor/ScriptEditor/NewBieGuideEditorWindow.cs
Assets/Editor/Tool/ExportGuides.cs
New file
@@ -0,0 +1,44 @@
using System.IO;
using Snxxz.UI;
using UnityEditor;
using UnityEngine;
public class ExportGuides
{
    [MenuItem("Tools/导出引导提示")]
    public static void ExportTipContent()
    {
        Debug.Log("开始导出");
        var path = StringUtility.Contact("Assets/", "GuidesTips.txt");
        if (File.Exists(path))
            File.Delete(path);
        var writer = File.CreateText(path);
        var guides = GuideConfig.GetValues();
        foreach (var config in guides)
        {
            var prefix = "";
            if (config.Type == 1)
                prefix = NewBieGuideScriptableObject.GuidesPrefixNewBie;
            else if (config.Type == 2)
                prefix = NewBieGuideScriptableObject.GuidesPrefixFun;
            else
                continue;
            foreach (var setpId in config.Steps)
            {
                NewBieGuideScriptableObject so = null;
                if (config.Type == 1)
                    so = ScriptableObjectLoader.LoadSoNewBieGuideStep(setpId);
                else
                    so = ScriptableObjectLoader.LoadSoFunctionalGuideStep(setpId);
                if (so == null || string.IsNullOrEmpty(so.tipContent))
                    continue;
                writer.WriteLine(string.Format("{0}{1} \t{2}", prefix, setpId, so.tipContent));
            }
        }
        writer.Close();
        Debug.Log("导出成功");
    }
}
Assets/Editor/Tool/ExportGuides.cs.meta
New file
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: d76a8e9dea9716844950d63b5b8c6d14
timeCreated: 1602732341
licenseType: Free
MonoImporter:
  serializedVersion: 2
  defaultReferences: []
  executionOrder: 0
  icon: {instanceID: 0}
  userData:
  assetBundleName:
  assetBundleVariant: