public static void AssetBundleClearPC()
 {
     LogCat.ClearLogs();
     StdioUtil.ClearDir(FilePathConst.PersistentAssetBundleRoot);
     EditorUtilityCat.DisplayDialog("AssetBundle PC_Persistent Clear Finished",
                                    FilePathConst.PersistentAssetBundleRoot);
 }
Esempio n. 2
0
 public static void GameDataClear_cs()
 {
     LogCat.ClearLogs();
     File.Delete(SerializeDataConst.SaveFilePathCS);
     File.Delete(SerializeDataConst.SaveFilePathCS2);
     EditorUtilityCat.DisplayDialog(string.Format("{0} Clear Finished\n{1} Clear Finished",
                                                  SerializeDataConst.SaveFilePathCS, SerializeDataConst.SaveFilePathCS2));
 }
Esempio n. 3
0
        public static void ConvertFilesEncoding()
        {
            string dirPath = FilePathConst.AssetsPath;

            //string dir_path = "F:/WorkSpace/Unity/Test/Assets/cscat/test";
            string[] filePaths = Directory.GetFiles(dirPath, "*.cs", SearchOption.AllDirectories);
            foreach (string filePath in filePaths)
            {
                SetFileEncoding(filePath.Replace('\\', '/'));
            }

            EditorUtilityCat.DisplayDialog("EncodingToUtf8 完成");
        }
Esempio n. 4
0
        public static void RelpaceScripts()
        {
            var rootPrefabPath = scriptsToReplacePath;

            if (Directory.Exists(rootPrefabPath))
            {
                string[] allPrefabPathes =
                    Directory.GetFiles(rootPrefabPath, "*.prefab", SearchOption.AllDirectories);
                foreach (string prefabPath in allPrefabPathes)
                {
                    bool isChanged = false;
                    var  lines     = File.ReadAllLines(prefabPath);
                    for (int i = 0; i < lines.Length; i++)
                    {
                        var    line = lines[i];
                        string matchedLineContent = MetaConst.Sprite_Regex.Match(line).Value;
                        if (!matchedLineContent.IsNullOrEmpty())
                        {
                            string oldFiledId = MetaConst.FileID_Regex.Match(matchedLineContent).Value;
                            string oldGUID    = MetaConst.Guid_Regex.Match(matchedLineContent).Value;

                            if (scriptsToReplaceDict.ContainsKey(oldFiledId) &&
                                oldGUID.Equals(scriptsToReplaceDict[oldFiledId]["old_guid"]))
                            {
                                isChanged = true;
                                var dict = scriptsToReplaceDict[oldFiledId];
                                lines[i] = Regex.Replace(lines[i], oldFiledId, dict["new_fileId"])
                                           .Replace(oldGUID, dict["new_guid"]).Replace(dict["old_type"], dict["new_type"]);
                            }
                        }
                    }

                    if (isChanged)
                    {
                        File.WriteAllLines(prefabPath, lines);
                    }
                }

                AssetDatabase.Refresh();
                EditorUtilityCat.DisplayDialog("Relpace Fonts finished");
            }
        }
Esempio n. 5
0
        public static void AssetBundleBuild()
        {
            LogCat.ClearLogs();
            //AssetBuildInfoManagerTest.Test();//需要自动设置依赖的,请在AssetBuildInfoManagerTest中添加Root文件,然后取消注释
            StdioUtil.CreateDirectoryIfNotExist(BuildConst.Output_Path);
            LuaBuildUtil.PreBuild();
            AssetBundleManifest manifest = BuildPipeline.BuildAssetBundles(BuildConst.Output_Path,
                                                                           BuildAssetBundleOptions.None,
                                                                           BuildTarget.Android);

            AssetPathMapBuildUtil.Build(manifest);
            AssetBundleMapBuildUtil.Build(manifest);
            ResVersionBuildUtil.Build();
            AssetPathRefBuildUtil.Build();
            var netBoxPath = (BuildConst.Output_Root_Path + "/NetBox.exe").Replace("/", "\\");

            Process.Start(netBoxPath);
            EditorUtilityCat.DisplayDialog(
                string.Format("AssetBundle Build Finished,output:\n  {0}", BuildConst.Output_Path),
                BuildConst.Output_Path);
        }
 public static void AssetBundleClearServer()
 {
     LogCat.ClearLogs();
     StdioUtil.ClearDir(BuildConst.Output_Path);
     EditorUtilityCat.DisplayDialog("AssetBundle Server Clear Finished", BuildConst.Output_Path);
 }
Esempio n. 7
0
 public static void AssetPathRefClearAll()
 {
     AssetPathRefManager.instance.ClearAll();
     AssetDatabase.Refresh();
     EditorUtilityCat.DisplayDialog("AssetPathRef Clear All");
 }