0312 资源 Mob文件夹改名Gmodels,鸿蒙系统下Mob会被当作缓存清理
| | |
| | | |
| | | private void ReAssetBundleName() |
| | | { |
| | | string _path = Application.dataPath + "/ResourcesOut/Mob"; |
| | | string _path = Application.dataPath + "/ResourcesOut/Gmodels"; |
| | | m_Path.Clear(); |
| | | |
| | | GetFileList(_path); |
| | |
| | | { |
| | | int _length = 0; |
| | | _assetPath = _filePath.Substring(_path.IndexOf("Assets")); |
| | | _temp = _filePath.Substring(_filePath.IndexOf("Mob") + 4); |
| | | _temp = _filePath.Substring(_filePath.IndexOf("Gmodels") + 8); |
| | | |
| | | if (_filePath.Contains("CreateRole")) |
| | | { |
| | |
| | | string _originalePath = string.Format("Assets/ART/Role/{0}/Materials/{1}.mat", path, assetName); |
| | | var _old = AssetDatabase.LoadAssetAtPath<Material>(_originalePath); |
| | | var _material = Object.Instantiate(_old); |
| | | AssetDatabase.CreateAsset(_material, "Assets/ResourcesOut/Mob/" + path + "/Materials/" + assetName + ".mat"); |
| | | AssetDatabase.CreateAsset(_material, "Assets/ResourcesOut/Gmodels/" + path + "/Materials/" + assetName + ".mat"); |
| | | var _importer = AssetImporter.GetAtPath(AssetDatabase.GetAssetPath(_material)); |
| | | _importer.assetBundleName = ResourcesPath.MOB_FOLDER_NAME |
| | | + (InstanceResourcesLoader.raceSuffix + bunedleName).ToLower(); |
| | |
| | | _originalAssetPath = string.Format("Assets/ART/Role/{0}/{1}.FBX", path, resName);
|
| | | }
|
| | |
|
| | | string _absAssetPath = string.Format("{0}Mob/{1}{2}.prefab", ResourcesPath.ResourcesOutPath, suffix, _tempPrefabName);
|
| | | string _assetPath = string.Format("{0}Mob/{1}{2}.prefab", ResourcesPath.ResourcesOutAssetPath, suffix, _tempPrefabName);
|
| | | string _absAssetPath = string.Format("{0}Gmodels/{1}{2}.prefab", ResourcesPath.ResourcesOutPath, suffix, _tempPrefabName);
|
| | | string _assetPath = string.Format("{0}Gmodels/{1}{2}.prefab", ResourcesPath.ResourcesOutAssetPath, suffix, _tempPrefabName);
|
| | |
|
| | | string _acAbsAssetPath = string.Format("{0}Mob/{1}/{2}{3}.controller", ResourcesPath.ResourcesOutPath, path, AnimatorControllerLoader.controllerSuffix, path);
|
| | | string _acAssetPath = string.Format("{0}Mob/{1}/{2}{3}.controller", ResourcesPath.ResourcesOutAssetPath, path, AnimatorControllerLoader.controllerSuffix, path);
|
| | | string _acAbsAssetPath = string.Format("{0}Gmodels/{1}/{2}{3}.controller", ResourcesPath.ResourcesOutPath, path, AnimatorControllerLoader.controllerSuffix, path);
|
| | | string _acAssetPath = string.Format("{0}Gmodels/{1}/{2}{3}.controller", ResourcesPath.ResourcesOutAssetPath, path, AnimatorControllerLoader.controllerSuffix, path);
|
| | |
|
| | | if (!outName.Equals(resName))
|
| | | {
|
| | | _acAbsAssetPath = string.Format("{0}Mob/{1}/{2}{3}.controller", ResourcesPath.ResourcesOutPath, path, AnimatorControllerLoader.controllerSuffix, outName);
|
| | | _acAssetPath = string.Format("{0}Mob/{1}/{2}{3}.controller", ResourcesPath.ResourcesOutAssetPath, path, AnimatorControllerLoader.controllerSuffix, outName);
|
| | | _acAbsAssetPath = string.Format("{0}Gmodels/{1}/{2}{3}.controller", ResourcesPath.ResourcesOutPath, path, AnimatorControllerLoader.controllerSuffix, outName);
|
| | | _acAssetPath = string.Format("{0}Gmodels/{1}/{2}{3}.controller", ResourcesPath.ResourcesOutAssetPath, path, AnimatorControllerLoader.controllerSuffix, outName);
|
| | | }
|
| | |
|
| | | if (string.IsNullOrEmpty(_absOriginalePath))
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | string _configPath = ResourcesPath.ResourcesOutAssetPath + "Mob/" + configName + ".asset";
|
| | | string _configPath = ResourcesPath.ResourcesOutAssetPath + "Gmodels/" + configName + ".asset";
|
| | | HorseEffectConfig _horseEffectConfig = AssetDatabase.LoadAssetAtPath<HorseEffectConfig>(_configPath);
|
| | | if (_horseEffectConfig == null
|
| | | || _horseEffectConfig.effectConfigList == null
|
| | |
| | | {
|
| | | string _absOriginaleDirectory = string.Format("{0}/ART/Role/{1}", Application.dataPath, path);
|
| | | string _assetOriginalDirectory = string.Format("Assets/ART/Role/{0}", path);
|
| | | string _absAssetDirectory = string.Format("{0}/ResourcesOut/Mob/{1}/AnimationClips", Application.dataPath, path);
|
| | | string _assetDirectory = string.Format("Assets/ResourcesOut/Mob/{0}/AnimationClips", path);
|
| | | string _absAssetDirectory = string.Format("{0}/ResourcesOut/Gmodels/{1}/AnimationClips", Application.dataPath, path);
|
| | | string _assetDirectory = string.Format("Assets/ResourcesOut/Gmodels/{0}/AnimationClips", path);
|
| | |
|
| | | if (!Directory.Exists(_absOriginaleDirectory))
|
| | | {
|
| | |
| | | outName = resName;
|
| | | }
|
| | |
|
| | | string _absAssetPath = string.Format("{0}Mob/{1}", ResourcesPath.ResourcesOutPath, outName);
|
| | | string _absAssetPath = string.Format("{0}Gmodels/{1}", ResourcesPath.ResourcesOutPath, outName);
|
| | |
|
| | | if (!Directory.Exists(_absAssetPath))
|
| | | {
|
| | | Directory.CreateDirectory(_absAssetPath);
|
| | | }
|
| | |
|
| | | _absAssetPath = string.Format("{0}Mob/{1}/{2}{3}.controller", ResourcesPath.ResourcesOutPath, outName, AnimatorControllerLoader.controllerSuffix, outName);
|
| | | string _assetPath = string.Format("{0}Mob/{1}/{2}{3}.controller", ResourcesPath.ResourcesOutAssetPath, outName, AnimatorControllerLoader.controllerSuffix, outName);
|
| | | _absAssetPath = string.Format("{0}Gmodels/{1}/{2}{3}.controller", ResourcesPath.ResourcesOutPath, outName, AnimatorControllerLoader.controllerSuffix, outName);
|
| | | string _assetPath = string.Format("{0}Gmodels/{1}/{2}{3}.controller", ResourcesPath.ResourcesOutAssetPath, outName, AnimatorControllerLoader.controllerSuffix, outName);
|
| | |
|
| | | if (templeName.Equals("Temple_AnimatorController_BossShow"))
|
| | | {
|
| | | _absAssetPath = string.Format("{0}Mob/{1}/{2}{3}.controller", ResourcesPath.ResourcesOutPath, resName, AnimatorControllerLoader.controllerShowSuffix, resName);
|
| | | _assetPath = string.Format("{0}Mob/{1}/{2}{3}.controller", ResourcesPath.ResourcesOutAssetPath, resName, AnimatorControllerLoader.controllerShowSuffix, resName);
|
| | | _absAssetPath = string.Format("{0}Gmodels/{1}/{2}{3}.controller", ResourcesPath.ResourcesOutPath, resName, AnimatorControllerLoader.controllerShowSuffix, resName);
|
| | | _assetPath = string.Format("{0}Gmodels/{1}/{2}{3}.controller", ResourcesPath.ResourcesOutAssetPath, resName, AnimatorControllerLoader.controllerShowSuffix, resName);
|
| | | }
|
| | |
|
| | | if (templeName.Equals("Temple_AnimatorController_Realm"))
|
| | | {
|
| | | _absAssetPath = string.Format("{0}Mob/{1}/{2}{3}.controller", ResourcesPath.ResourcesOutPath, resName, AnimatorControllerLoader.controllerRealmSuffix, resName);
|
| | | _assetPath = string.Format("{0}Mob/{1}/{2}{3}.controller", ResourcesPath.ResourcesOutAssetPath, resName, AnimatorControllerLoader.controllerRealmSuffix, resName);
|
| | | _absAssetPath = string.Format("{0}Gmodels/{1}/{2}{3}.controller", ResourcesPath.ResourcesOutPath, resName, AnimatorControllerLoader.controllerRealmSuffix, resName);
|
| | | _assetPath = string.Format("{0}Gmodels/{1}/{2}{3}.controller", ResourcesPath.ResourcesOutAssetPath, resName, AnimatorControllerLoader.controllerRealmSuffix, resName);
|
| | | }
|
| | |
|
| | | if (templeName.Equals("Temple_AnimatorController_UI"))
|
| | | {
|
| | | _absAssetPath = string.Format("{0}Mob/{1}/{2}{3}.controller", ResourcesPath.ResourcesOutPath, outName, AnimatorControllerLoader.controllerUISuffix, outName);
|
| | | _assetPath = string.Format("{0}Mob/{1}/{2}{3}.controller", ResourcesPath.ResourcesOutAssetPath, outName, AnimatorControllerLoader.controllerUISuffix, outName);
|
| | | _absAssetPath = string.Format("{0}Gmodels/{1}/{2}{3}.controller", ResourcesPath.ResourcesOutPath, outName, AnimatorControllerLoader.controllerUISuffix, outName);
|
| | | _assetPath = string.Format("{0}Gmodels/{1}/{2}{3}.controller", ResourcesPath.ResourcesOutAssetPath, outName, AnimatorControllerLoader.controllerUISuffix, outName);
|
| | | }
|
| | |
|
| | | string _templePath = string.Format("{0}Mob/{1}.controller", ResourcesPath.ResourcesOutPath, templeName);
|
| | | string _templePath = string.Format("{0}Gmodels/{1}.controller", ResourcesPath.ResourcesOutPath, templeName);
|
| | |
|
| | | if (File.Exists(_absAssetPath))
|
| | | {
|
| | |
| | |
|
| | | // 读取配置文件
|
| | | string _configPath = StringUtility.Contact(ResourcesPath.ResourcesOutAssetPath,
|
| | | "mob/",
|
| | | "gmodels/",
|
| | | configName,
|
| | | ".asset");
|
| | |
|
| | |
| | | {
|
| | |
|
| | | string _assetPath = StringUtility.Contact(ResourcesPath.ResourcesOutAssetPath,
|
| | | "mob/",
|
| | | "gmodels/",
|
| | | modelName,
|
| | | "/AnimationClips/",
|
| | | clipName,
|
| | |
| | | for (int i = 0; i < assetBundles.Length; i++)
|
| | | {
|
| | | var bundleName = assetBundles[i];
|
| | | if (bundleName.StartsWith("mob") || bundleName.StartsWith("effect") || bundleName.StartsWith("graphic"))
|
| | | if (bundleName.StartsWith("gmodels") || bundleName.StartsWith("effect") || bundleName.StartsWith("graphic"))
|
| | | {
|
| | | targetAssetBundles.Add(bundleName);
|
| | | }
|
| | |
| | |
|
| | | var excludeFileFullNames = new List<string>();
|
| | | var tempFiles = new List<FileInfo>();
|
| | | FileExtersion.GetAllDirectoryFileInfos(StringUtility.Contact(_assetBundlePath, "/mob"), tempFiles);
|
| | | FileExtersion.GetAllDirectoryFileInfos(StringUtility.Contact(_assetBundlePath, "/gmodels"), tempFiles);
|
| | | foreach (var file in tempFiles)
|
| | | {
|
| | | var extersion = Path.GetExtension(file.FullName);
|
| | |
| | | |
| | | var excludeFileFullNames = new List<string>(); |
| | | var tempFiles = new List<FileInfo>(); |
| | | FileExtersion.GetAllDirectoryFileInfos(StringUtility.Contact(assetPath, "/mob"), tempFiles); |
| | | FileExtersion.GetAllDirectoryFileInfos(StringUtility.Contact(assetPath, "/gmodels"), tempFiles); |
| | | foreach (var file in tempFiles) |
| | | { |
| | | var extersion = Path.GetExtension(file.FullName); |
| | |
| | |
|
| | | public class UpdateMobSetting
|
| | | {
|
| | | static string rootPath = Application.dataPath + "/ResourcesOut/Mob";
|
| | | static string assetPath = "Assets/ResourcesOut/Mob";
|
| | | static string createroleRoot = Application.dataPath + "/ResourcesOut/Mob/CreateRole";
|
| | | static string createroleAssetPath = "Assets/ResourcesOut/Mob/CreateRole";
|
| | | static string rootPath = Application.dataPath + "/ResourcesOut/Gmodels";
|
| | | static string assetPath = "Assets/ResourcesOut/Gmodels";
|
| | | static string createroleRoot = Application.dataPath + "/ResourcesOut/Gmodels/CreateRole";
|
| | | static string createroleAssetPath = "Assets/ResourcesOut/Gmodels/CreateRole";
|
| | |
|
| | | static string zsMaterialPath_Origin = Application.dataPath + "/Art/Role/A_Zs/Materials";
|
| | | static string fsMaterialPath_Origin = Application.dataPath + "/Art/Role/A_Fs/Materials";
|
| | |
|
| | | static string zsMaterialPath_OutPut = Application.dataPath + "/ResourcesOut/Mob/A_Zs/Materials";
|
| | | static string fsMaterialPath_OutPut = Application.dataPath + "/ResourcesOut/Mob/A_Fs/Materials";
|
| | | static string zsMaterialPath_OutPut = Application.dataPath + "/ResourcesOut/Gmodels/A_Zs/Materials";
|
| | | static string fsMaterialPath_OutPut = Application.dataPath + "/ResourcesOut/Gmodels/A_Fs/Materials";
|
| | |
|
| | | [MenuItem("程序/设置资源包名/更新Mob(All) AssetBundleName")]
|
| | | public static void SetAllMobAssetBundleName()
|
| | |
| | | .Replace(".prefab", "")
|
| | | .Replace("Prefab_Hand", "");
|
| | |
|
| | | importer.assetBundleName = StringUtility.Contact("mob/prefab_race", hostfix);
|
| | | importer.assetBundleName = StringUtility.Contact("gmodels/prefab_race", hostfix);
|
| | | // EditorUtility.SetDirty(importer);
|
| | | }
|
| | |
|
| | |
| | | var importerPath = createroleAssetPath + Path.DirectorySeparatorChar + file.Name;
|
| | | var extersion = Path.GetExtension(file.FullName);
|
| | | var importer = AssetImporter.GetAtPath(importerPath);
|
| | | importer.assetBundleName = "mob/createrole";
|
| | | importer.assetBundleName = "gmodels/createrole";
|
| | | // EditorUtility.SetDirty(importer);
|
| | | }
|
| | |
|
| | |
| | | if (_file.Name.StartsWith("A_Zs_Sz"))
|
| | | {
|
| | | string _abName = Path.GetFileNameWithoutExtension(_file.Name).Replace("_Dm", "");
|
| | | _importer.assetBundleName = "mob/prefab_race_" + _abName;
|
| | | _importer.assetBundleName = "gmodels/prefab_race_" + _abName;
|
| | | }
|
| | | else
|
| | | {
|
| | | string _abName = Path.GetFileNameWithoutExtension(_file.Name).Replace("_02", "").Replace("_Dm", "").Replace("_Dm_02", "");
|
| | | _importer.assetBundleName = "mob/prefab_race_" + _abName;
|
| | | _importer.assetBundleName = "gmodels/prefab_race_" + _abName;
|
| | | }
|
| | | // EditorUtility.SetDirty(_importer);
|
| | | }
|
| | |
| | | if (_file.Name.StartsWith("A_Fs_Sz"))
|
| | | {
|
| | | string _abName = Path.GetFileNameWithoutExtension(_file.Name).Replace("_Dm", "");
|
| | | _importer.assetBundleName = "mob/prefab_race_" + _abName;
|
| | | _importer.assetBundleName = "gmodels/prefab_race_" + _abName;
|
| | | }
|
| | | else
|
| | | {
|
| | | string _abName = Path.GetFileNameWithoutExtension(_file.Name).Replace("_02", "").Replace("_Dm", "").Replace("_Dm_02", "");
|
| | | _importer.assetBundleName = "mob/prefab_race_" + _abName;
|
| | | _importer.assetBundleName = "gmodels/prefab_race_" + _abName;
|
| | | }
|
| | | // EditorUtility.SetDirty(_importer);
|
| | | }
|
| | |
| | | // var importerPath = assetPath + "/A_Zs/Materials/" + file.Name;
|
| | | // var importer = AssetImporter.GetAtPath(importerPath);
|
| | |
|
| | | // importer.assetBundleName = "mob/a_zs_materials";
|
| | | // importer.assetBundleName = "gmodels/a_zs_materials";
|
| | | // EditorUtility.SetDirty(importer);
|
| | | //}
|
| | |
|
| | |
| | | // var importerPath = assetPath + "/A_Fs/Materials/" + file.Name;
|
| | | // var importer = AssetImporter.GetAtPath(importerPath);
|
| | |
|
| | | // importer.assetBundleName = "mob/a_fs_materials";
|
| | | // importer.assetBundleName = "gmodels/a_fs_materials";
|
| | | // EditorUtility.SetDirty(importer);
|
| | | //}
|
| | | DebugEx.Log("Mob资源包名更新完成!");
|
| | | DebugEx.Log("Gmodels资源包名更新完成!");
|
| | | //AssetDatabase.SaveAssets();
|
| | | //AssetDatabase.Refresh();
|
| | | }
|