Esempio n. 1
0
    /// <summary>
    /// 获取导出资源路径目录
    /// </summary>
    /// <returns></returns>
    public static string GetExportPath()
    {
        BuildTarget platfrom = EditorUserBuildSettings.activeBuildTarget;
        string      basePath = AppSetting.ExportResBaseDir;

        if (File.Exists(basePath))
        {
            MyEditorTools.ShowDialog("路径配置错误: " + basePath);
            throw new System.Exception("路径配置错误");
        }
        string path         = null;
        var    platformName = Utility.GetPlatformName();

        path = basePath + platformName + "/";
        MyEditorTools.CreateDir(path);
        return(path);
    }
Esempio n. 2
0
    /// <summary>
    /// 创建StreamingAssets链接
    /// </summary>
    public static void MkLinkStreamingAssets()
    {
        string linkPath = Application.streamingAssetsPath + "/" + Utility.GetPlatformName();

        if (IsLinkStreamingAssets)
        {
            MyEditorTools.CreateDir(Application.streamingAssetsPath);
            var exportPath = AppSetting.ExportResBaseDir + Utility.GetPlatformName();
            MyEditorTools.DeleteDir(linkPath);     //删除复制过来的文件夹
            SymbolLinkFolder(exportPath, linkPath);
        }
        else
        {
            DeleteLink(linkPath);
        }
        AssetDatabase.Refresh();
    }