//是否有不同的txt资源需要打包
    static bool GetDifffTxtPath(string srcPath, ref Dictionary <string, string> dicDiffPath)
    {
        List <string> diffList = new List <string>();

        ConfigPathSet configPathSet = ConfigPathSet.GetConfig();
        string        destPath      = configPathSet.projectTxtPath;

        if (!CheckPath(ref destPath))
        {
            return(false);
        }

        ImprotStaticDataResult importResult = ImportStaticData.ExecConfigPathSet(diffList, srcPath, destPath);

        if (importResult != ImprotStaticDataResult.Success)
        {
            Log("Log: ", "import static Txt failed!\n error code : " + importResult.ToString());
            Debug.Log("导入静态数据Txt失败!\n 错误代码 : " + importResult.ToString());
            return(false);
        }

        foreach (var path in diffList)
        {
            string fileName  = Path.GetFileNameWithoutExtension(path);
            string assetPath = ToolCommon.GetAssetPath(path);

            if (!dicDiffPath.ContainsKey(fileName))
            {
                dicDiffPath.Add(fileName, assetPath);
            }
        }

        return(true);
    }
Beispiel #2
0
    public static void Exec(BuildTarget target)
    {
        Dictionary <string, string> dicPath = new Dictionary <string, string>();

        foreach (UnityEngine.Object o in Selection.GetFiltered(typeof(UnityEngine.Object), SelectionMode.DeepAssets))
        {
            string filePath = AssetDatabase.GetAssetPath(o);
            if (Path.GetExtension(filePath) == ".txt")
            {
                string fileName      = Path.GetFileNameWithoutExtension(filePath);
                string assetFilePath = ToolCommon.GetAssetPath(filePath);

                if (!dicPath.ContainsKey(fileName))
                {
                    dicPath.Add(fileName, assetFilePath);
                }
            }
        }

        ConfigPathSet configPathSet = ConfigPathSet.GetConfig();
        string        boundlePath   = configPathSet.strBoundlePath;

        if (!CreateConfigAssetboundle.CheckPath(ref boundlePath))
        {
            return;
        }

        CreateConfigAssetboundle.InitTempLogs();
        CreateConfigAssetboundle.ExecutePath(boundlePath, target, dicPath);
    }