Beispiel #1
0
    public static void ClearCoyProjectRes()
    {
        string targetDir = CopyProjectTargetDir;

        //清理目标工程下未加密的配置文件
        List <string> configFileList = new List <string>();

        MyFileUtil.GetFileList(targetDir + "Assets/StreamingAssets/Config", ref configFileList, ".xml");
        foreach (string filePath in configFileList)
        {
            MyFileUtil.DeleteFile(filePath);
        }

        //清理sdk配置文件
        // string localVersionInfoConfigFilePath = targetDir + "Assets/StreamingAssets/Config/" + LocalVersionInfoConfig.fileName + MyFileUtil.EncryptXMLFileSuffix;
        // MyFileUtil.DeleteFile(localVersionInfoConfigFilePath);

        //清理目标工程下未加密的lua文件
        string luaDir = targetDir + "Assets/StreamingAssets/Lua";

        MyFileUtil.DeleteDir(luaDir);

        //清理lua项目配置文件
        List <string> luaProjectFiles    = new List <string>();
        string        streamingAssetsDir = targetDir + "Assets/StreamingAssets";
        DirectoryInfo di = new DirectoryInfo(streamingAssetsDir);
        var           fs = di.GetFiles();

        foreach (var item in fs)
        {
            if (item.FullName.EndsWith(".user"))
            {
                MyFileUtil.DeleteFile(item.FullName);
            }

            if (item.FullName.EndsWith(".luaproj"))
            {
                MyFileUtil.DeleteFile(item.FullName);
            }

            if (item.FullName.EndsWith(".config"))
            {
                MyFileUtil.DeleteFile(item.FullName);
            }
        }

        //清理Resources目录下的文件
        string ResourcesDir = targetDir + "Assets/Resources/" + ResourcesManager.DirNameForAssetBundlesBuildFrom;

        MyFileUtil.DeleteDir(ResourcesDir);


        Debug.Log("清理拷贝工程多余资源");
    }
Beispiel #2
0
    //[MenuItem("Build/清理当前工程下加密的lua文件")]
    public static void ClearCurrentProjectLuaRes()
    {
        List <string> srcLuaFileList = new List <string>();

        MyFileUtil.GetFileList(ResourcesManager.LuaDirForBuild, ref srcLuaFileList, MyFileUtil.EncryptXMLFileSuffix);
        foreach (string filePath in srcLuaFileList)
        {
            MyFileUtil.DeleteFile(filePath);
        }

        MyFileUtil.DeleteFile(ResourcesManager.LuaZipFileFullPath);

        AssetDatabase.Refresh();
    }
Beispiel #3
0
    public static void ClearCurrentProjectRes()
    {
        //清理当前工程下加密的配置文件
        List <string> srcConfigFileList = new List <string>();

        MyFileUtil.GetFileList(MyFileUtil.InnerConfigDir, ref srcConfigFileList, MyFileUtil.EncryptXMLFileSuffix);

        foreach (string filePath in srcConfigFileList)
        {
            MyFileUtil.DeleteFile(filePath);
        }

        //清理当前工程下加密的lua文件
        ClearCurrentProjectLuaRes();

        AssetDatabase.Refresh();
        Debug.Log("清理当前工程多余资源");
    }