0312 资源 Mob文件夹改名Gmodels,鸿蒙系统下Mob会被当作缓存清理
| | |
| | |
|
| | | #region 具体asset资源读取路径
|
| | |
|
| | | public static readonly string MOB_FOLDER_NAME = "mob/";
|
| | | public static readonly string MOB_FOLDER_NAME = "Gmodels/";
|
| | | public static readonly string MOB_SUFFIX = "prefab_race_";
|
| | |
|
| | | public static readonly string EFFECT_Folder_Name = "effect/";
|
| | |
| | | |
| | | if (!string.IsNullOrEmpty(_resName.Trim())) |
| | | { |
| | | string _path = "Assets/ResourcesOut/Mob/Prefab_Race_" + _resName + ".prefab"; |
| | | string _path = "Assets/ResourcesOut/Gmodels/Prefab_Race_" + _resName + ".prefab"; |
| | | _go = AssetDatabase.LoadAssetAtPath<GameObject>(_path); |
| | | if (_go) |
| | | { |
| | |
| | | |
| | | if (!string.IsNullOrEmpty(_resName.Trim())) |
| | | { |
| | | string _path = "Assets/ResourcesOut/Mob/Prefab_Race_" + _resName + ".prefab"; |
| | | string _path = "Assets/ResourcesOut/Gmodels/Prefab_Race_" + _resName + ".prefab"; |
| | | _go = AssetDatabase.LoadAssetAtPath<GameObject>(_path); |
| | | if (_go) |
| | | { |
| | |
| | | return null; |
| | | } |
| | | |
| | | string _path = "Assets/ResourcesOut/Mob/Prefab_Race_" + name + ".prefab"; |
| | | string _path = "Assets/ResourcesOut/Gmodels/Prefab_Race_" + name + ".prefab"; |
| | | var _obj = AssetDatabase.LoadAssetAtPath<GameObject>(_path); |
| | | if (!_obj) |
| | | { |
| | |
| | | { |
| | | if (!string.IsNullOrEmpty(sceneName)) |
| | | { |
| | | string _path = "Assets/ResourcesOut/Mob/Prefab_Race_" + sceneName + ".prefab"; |
| | | string _path = "Assets/ResourcesOut/Gmodels/Prefab_Race_" + sceneName + ".prefab"; |
| | | var _obj = AssetDatabase.LoadAssetAtPath<GameObject>(_path); |
| | | if (!_obj) |
| | | { |
| | |
| | | { |
| | | if (!string.IsNullOrEmpty(sceneName)) |
| | | { |
| | | string _path = "Assets/ResourcesOut/Mob/Prefab_Race_" + sceneName + ".prefab"; |
| | | string _path = "Assets/ResourcesOut/Gmodels/Prefab_Race_" + sceneName + ".prefab"; |
| | | var _obj = AssetDatabase.LoadAssetAtPath<GameObject>(_path); |
| | | if (!_obj) |
| | | { |
| | |
| | | { |
| | | #if UNITY_EDITOR |
| | | string _resourcesPath = StringUtility.Contact(ResourcesPath.ResourcesOutAssetPath, |
| | | "mob/", |
| | | "gmodels/", |
| | | name, |
| | | "/AnimationClips/", |
| | | clipName, |
| | |
| | | { |
| | | #if UNITY_EDITOR |
| | | string _resourcesPath = StringUtility.Contact(ResourcesPath.ResourcesOutAssetPath, |
| | | "mob/", |
| | | "gmodels/", |
| | | _name, |
| | | "/", |
| | | suffix, |
| | |
| | |
|
| | | var _pool = RequestPool(_prefab);
|
| | | _pool.assetName = InstanceResourcesLoader.emptyJyName;
|
| | | _pool.assetBundleName = "mob/prefab_race_jy";
|
| | | _pool.assetBundleName = "gmodels/prefab_race_jy";
|
| | |
|
| | | return _pool.Request();
|
| | | }
|
| | |
| | | {
|
| | | #if UNITY_EDITOR
|
| | | string _resourcePath = StringUtility.Contact(ResourcesPath.ResourcesOutAssetPath,
|
| | | "Mob/",
|
| | | "Gmodels/",
|
| | | emptyJyName,
|
| | | ".prefab");
|
| | |
|
| | |
| | | }
|
| | | else
|
| | | {
|
| | | _prefab = AssetBundleUtility.Instance.Sync_LoadAsset("mob/prefab_race_jy", emptyJyName) as GameObject;
|
| | | _prefab = AssetBundleUtility.Instance.Sync_LoadAsset("gmodels/prefab_race_jy", emptyJyName) as GameObject;
|
| | | }
|
| | |
|
| | | if (_prefab == null)
|
| | | {
|
| | | DebugEx.LogErrorFormat("InstanceResourcesLoader.LoadModel() => 加载不到资源: {0}/{1} ", "mob/prefab_race_jy", emptyJyName);
|
| | | DebugEx.LogErrorFormat("InstanceResourcesLoader.LoadModel() => 加载不到资源: {0}/{1} ", "gmodels/prefab_race_jy", emptyJyName);
|
| | | }
|
| | |
|
| | | return _prefab;
|
| | |
| | | {
|
| | | #if UNITY_EDITOR
|
| | | string _resourcePath = StringUtility.Contact(ResourcesPath.ResourcesOutAssetPath,
|
| | | "Mob/CreateRole/",
|
| | | "Gmodels/CreateRole/",
|
| | | _name,
|
| | | ".prefab");
|
| | |
|
| | |
| | | }
|
| | | else
|
| | | {
|
| | | var assetInfo = new AssetInfo("mob/createrole", _name);
|
| | | var assetInfo = new AssetInfo("gmodels/createrole", _name);
|
| | | AssetBundleUtility.Instance.Co_LoadAsset(assetInfo, _callBack);
|
| | | }
|
| | | }
|
| | |
| | | {
|
| | | #if UNITY_EDITOR
|
| | | string _resourcePath = StringUtility.Contact(ResourcesPath.ResourcesOutAssetPath,
|
| | | "Mob/",
|
| | | "Gmodels/",
|
| | | _suffix + name,
|
| | | ".prefab");
|
| | |
|
| | |
| | | {
|
| | | #if UNITY_EDITOR
|
| | | string _resourcePath = StringUtility.Contact(ResourcesPath.ResourcesOutAssetPath,
|
| | | "Mob/",
|
| | | "Gmodels/",
|
| | | _suffix + _name,
|
| | | ".prefab");
|
| | |
|
| | |
| | | {
|
| | | #if UNITY_EDITOR
|
| | | string _resourcePath = StringUtility.Contact(ResourcesPath.ResourcesOutAssetPath,
|
| | | "Mob/",
|
| | | "Gmodels/",
|
| | | assetName,
|
| | | ".prefab");
|
| | |
|
| | |
| | | {
|
| | | #if UNITY_EDITOR
|
| | | string _resourcePath = StringUtility.Contact(ResourcesPath.ResourcesOutAssetPath,
|
| | | "Mob/",
|
| | | "Gmodels/",
|
| | | assetName,
|
| | | ".prefab");
|
| | |
|
| | |
| | | { |
| | | #if UNITY_EDITOR |
| | | string _resourcePath = StringUtility.Contact(ResourcesPath.ResourcesOutAssetPath, |
| | | "Mob/", |
| | | "Gmodels/", |
| | | _parentDirName, |
| | | "/Materials/", |
| | | _assetName, |
| | |
| | | { |
| | | HorseEffectConfig _config = CreateInstance<HorseEffectConfig>(); |
| | | string _name = "horseEffectConfig"; |
| | | string _path = ResourcesPath.ResourcesOutPath + "Mob"; |
| | | string _path = ResourcesPath.ResourcesOutPath + "Gmodels"; |
| | | if (Directory.Exists(_path) == false) |
| | | { |
| | | Directory.CreateDirectory(_path); |
| | | } |
| | | _path = StringUtility.Contact(ResourcesPath.ResourcesOutAssetPath, |
| | | "Mob/", |
| | | "Gmodels/", |
| | | _name, |
| | | ".asset"); |
| | | AssetDatabase.CreateAsset(_config, _path); |
| | |
| | |
|
| | | if (!AssetSource.mobFromEditor)
|
| | | {
|
| | | AssetBundleUtility.Instance.UnloadAssetBundle("mob/prefab_race_n017a", true, true);
|
| | | AssetBundleUtility.Instance.UnloadAssetBundle("gmodels/prefab_race_n017a", true, true);
|
| | | }
|
| | |
|
| | | DebugEx.Log("前期结束...");
|
| | |
| | |
|
| | | if (!AssetSource.mobFromEditor)
|
| | | {
|
| | | AssetBundleUtility.Instance.UnloadAssetBundle("mob/prefab_race_n017a", true, true);
|
| | | AssetBundleUtility.Instance.UnloadAssetBundle("gmodels/prefab_race_n017a", true, true);
|
| | | }
|
| | |
|
| | | // 资源卸载
|
| | |
| | | return AssetCategory.UI;
|
| | | else if (m_RelativePath.StartsWith("audio/"))
|
| | | return AssetCategory.Audio;
|
| | | else if (m_RelativePath.StartsWith("mob/"))
|
| | | else if (m_RelativePath.StartsWith("gmodels/"))
|
| | | return AssetCategory.Mob;
|
| | | else if (m_RelativePath.StartsWith("maps/"))
|
| | | return AssetCategory.Scene;
|
| | |
| | | if (npcConfig != null)
|
| | | {
|
| | | var assetbundleName = StringUtility.Contact("prefab_race_", npcConfig.MODE.ToLower());
|
| | | if (!IsAssetValid(StringUtility.Contact("mob/", assetbundleName)))
|
| | | if (!IsAssetValid(StringUtility.Contact("gmodels/", assetbundleName)))
|
| | | {
|
| | | return false;
|
| | | }
|
| | |
| | | jobModels.Clear(); |
| | | if (!AssetSource.mobFromEditor) |
| | | { |
| | | AssetBundleUtility.Instance.UnloadAssetBundle("mob/createrole", true, false); |
| | | AssetBundleUtility.Instance.UnloadAssetBundle("gmodels/createrole", true, false); |
| | | } |
| | | } |
| | | |