| | |
| | | using UnityEngine; |
| | | using TableConfig; |
| | | using System; |
| | | #if UNITY_EDITOR |
| | | using UnityEditor; |
| | | #endif |
| | | |
| | | public class InstanceResourcesLoader |
| | | { |
| | | public static readonly string raceSuffix = "Prefab_Race_"; |
| | | public static readonly string horseSuffix = "Prefab_Horse_"; |
| | | public static readonly string weaponSuffix = "Prefab_Weapon_"; |
| | | public static readonly string secondarySuffix = "Prefab_Secondary_"; |
| | | public static readonly string wingSuffix = "Prefab_Wing_"; |
| | | |
| | | public static GameObject LoadNpc(int id) |
| | | { |
| | | NPCConfig _m = ConfigManager.Instance.GetTemplate<NPCConfig>(id); |
| | | |
| | | if (_m == null || string.IsNullOrEmpty(_m.MODE) || _m.MODE.Equals("0")) |
| | | { |
| | | return null; |
| | | } |
| | | |
| | | return LoadModelPrefab(raceSuffix, _m.MODE); |
| | | } |
| | | |
| | | public static GameObject LoadDefaultFightNPC() |
| | | { |
| | | return LoadMob(GeneralConfig.Instance.ModeDefaultConfig[1][0], |
| | | GeneralConfig.Instance.ModeDefaultConfig[1][1]); |
| | | } |
| | | |
| | | public static GameObject LoadDefaultFuncNPC() |
| | | { |
| | | return LoadMob(GeneralConfig.Instance.ModeDefaultConfig[0][0], |
| | | GeneralConfig.Instance.ModeDefaultConfig[0][1]); |
| | | } |
| | | |
| | | public static GameObject LoadDefaultHorse() |
| | | { |
| | | return LoadMob(GeneralConfig.Instance.ModeDefaultConfig[3][0], |
| | | GeneralConfig.Instance.ModeDefaultConfig[3][1]); |
| | | } |
| | | |
| | | public static GameObject LoadDefaultPet() |
| | | { |
| | | return LoadMob(GeneralConfig.Instance.ModeDefaultConfig[2][0], |
| | | GeneralConfig.Instance.ModeDefaultConfig[2][1]); |
| | | } |
| | | |
| | | public static GameObject LoadNpcPrefab(int npcID) |
| | | { |
| | | NPCConfig _m = ConfigManager.Instance.GetTemplate<NPCConfig>(npcID); |
| | | |
| | | if (_m == null || _m.MODE.Equals("0")) |
| | | { |
| | | return null; |
| | | } |
| | | |
| | | string _assetName; |
| | | string _assetBundleName; |
| | | |
| | | if (GAMgr.Instance.s_NpcID2Assetname.TryGetValue(npcID, out _assetName)) |
| | | { |
| | | _assetBundleName = GAMgr.Instance.s_NpcID2BundleName[npcID]; |
| | | } |
| | | else |
| | | { |
| | | _assetName = StringUtility.Contact(raceSuffix, _m.MODE); |
| | | _assetBundleName = StringUtility.Contact(ResourcesPath.MOB_FOLDER_NAME, _assetName); |
| | | GAMgr.Instance.s_NpcID2Assetname[npcID] = _assetName; |
| | | GAMgr.Instance.s_NpcID2BundleName[npcID] = _assetBundleName; |
| | | } |
| | | |
| | | return LoadMob(_assetBundleName, _assetName); |
| | | } |
| | | |
| | | public static GameObject LoadModelRes(int id) |
| | | { |
| | | |
| | | ModelResConfig _m = ConfigManager.Instance.GetTemplate<ModelResConfig>(id); |
| | | |
| | | if (_m == null) |
| | | { |
| | | return null; |
| | | } |
| | | |
| | | string _name = _m.ResourcesName; |
| | | int _index = _name.IndexOf('/'); |
| | | if (_index != -1) |
| | | { |
| | | _name = _name.Substring(_index + 1); |
| | | } |
| | | |
| | | if (_m.Type == (int)E_ModelResType.Suit) |
| | | { |
| | | return LoadModelPrefab(raceSuffix, _name); |
| | | } |
| | | else if (_m.Type == (int)E_ModelResType.Horse) |
| | | { |
| | | return LoadModelPrefab(horseSuffix, _name); |
| | | } |
| | | else if (_m.Type == (int)E_ModelResType.Wing) |
| | | { |
| | | return LoadModelPrefab(wingSuffix, _name); |
| | | } |
| | | else if (_m.Type == (int)E_ModelResType.Weapon) |
| | | { |
| | | return LoadModelPrefab(weaponSuffix, _name); |
| | | } |
| | | else if (_m.Type == (int)E_ModelResType.Secondary) |
| | | { |
| | | return LoadModelPrefab(secondarySuffix, _name); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public static void LoadCreateRole(int job, Action<bool, UnityEngine.Object> _callBack) |
| | | { |
| | | string _name = "Zs"; |
| | | switch (job) |
| | | { |
| | | case 1: |
| | | _name = "Zs"; |
| | | break; |
| | | case 2: |
| | | _name = "Fs"; |
| | | break; |
| | | case 3: |
| | | _name = "Zs"; |
| | | break; |
| | | case 4: |
| | | _name = "Zs"; |
| | | break; |
| | | } |
| | | |
| | | if (AssetSource.mobFromEditor) |
| | | { |
| | | #if UNITY_EDITOR |
| | | string _resourcePath = StringUtility.Contact(ResourcesPath.ResourcesOutAssetPath, |
| | | "Mob/CreateRole/", |
| | | _name, |
| | | ".prefab"); |
| | | |
| | | var gameObject = AssetDatabase.LoadAssetAtPath<GameObject>(_resourcePath); |
| | | |
| | | if (_callBack != null) |
| | | { |
| | | _callBack(true, gameObject); |
| | | } |
| | | #endif |
| | | } |
| | | else |
| | | { |
| | | var assetInfo = new AssetInfo("mob/createrole", _name); |
| | | AssetBundleUtility.Instance.Co_LoadAsset(assetInfo, _callBack); |
| | | } |
| | | } |
| | | |
| | | private static GameObject LoadModelPrefab(string _suffix, string name) |
| | | { |
| | | GameObject _gameObject = null; |
| | | if (AssetSource.mobFromEditor) |
| | | { |
| | | #if UNITY_EDITOR |
| | | string _resourcePath = StringUtility.Contact(ResourcesPath.ResourcesOutAssetPath, |
| | | "Mob/", |
| | | _suffix + name, |
| | | ".prefab"); |
| | | |
| | | _gameObject = AssetDatabase.LoadAssetAtPath<GameObject>(_resourcePath); |
| | | #endif |
| | | } |
| | | else |
| | | { |
| | | string _bundleName = StringUtility.Contact(ResourcesPath.MOB_FOLDER_NAME, "prefab_race_" + name); |
| | | string _assetName = _suffix + name; |
| | | AssetInfo _assetInfo = new AssetInfo(_bundleName, _assetName); |
| | | _gameObject = AssetBundleUtility.Instance.Sync_LoadAsset(_assetInfo) as GameObject; |
| | | } |
| | | |
| | | if (_gameObject == null) |
| | | { |
| | | DesignDebug.LogErrorFormat("InstanceResourcesLoader.LoadModel() => 加载不到资源: {0} ", name); |
| | | } |
| | | |
| | | return _gameObject; |
| | | } |
| | | |
| | | public static GameObject LoadMob(string assetBundleName, string assetName) |
| | | { |
| | | GameObject _gameObject = null; |
| | | if (AssetSource.mobFromEditor) |
| | | { |
| | | #if UNITY_EDITOR |
| | | string _resourcePath = StringUtility.Contact(ResourcesPath.ResourcesOutAssetPath, |
| | | "Mob/", |
| | | assetName, |
| | | ".prefab"); |
| | | |
| | | _gameObject = AssetDatabase.LoadAssetAtPath<GameObject>(_resourcePath); |
| | | #endif |
| | | } |
| | | else |
| | | { |
| | | _gameObject = AssetBundleUtility.Instance.Sync_LoadAsset(assetBundleName, assetName) as GameObject; |
| | | } |
| | | |
| | | if (_gameObject == null) |
| | | { |
| | | DesignDebug.LogErrorFormat("InstanceResourcesLoader.LoadModel() => 加载不到资源: {0}/{1} ", assetBundleName, assetName); |
| | | } |
| | | |
| | | return _gameObject; |
| | | } |
| | | |
| | | public static void UnloadAsset(string bundleName, string assetName) |
| | | { |
| | | if (!AssetSource.mobFromEditor) |
| | | { |
| | | AssetBundleUtility.Instance.UnloadAsset(bundleName, assetName); |
| | | AssetBundleUtility.Instance.UnloadAssetBundle(bundleName, true, false); |
| | | } |
| | | } |
| | | |
| | | public static GameObject LoadEffect(int id) |
| | | { |
| | | GameObject _gameObject = null; |
| | | |
| | | EffectConfig _effectModel = ConfigManager.Instance.GetTemplate<EffectConfig>(id); |
| | | |
| | | if (_effectModel == null) |
| | | { |
| | | return null; |
| | | } |
| | | |
| | | if (AssetSource.effectFromEditor) |
| | | { |
| | | #if UNITY_EDITOR |
| | | string _resourcePath = StringUtility.Contact(ResourcesPath.ResourcesOutAssetPath, |
| | | "Effect/", |
| | | _effectModel.packageName, |
| | | "/", |
| | | _effectModel.fxName, |
| | | ".prefab"); |
| | | _gameObject = AssetDatabase.LoadAssetAtPath<GameObject>(_resourcePath); |
| | | #endif |
| | | } |
| | | else |
| | | { |
| | | string _bundleName = StringUtility.Contact(ResourcesPath.EFFECT_Folder_Name, _effectModel.packageName); |
| | | AssetInfo _assetInfo = new AssetInfo(_bundleName, _effectModel.fxName); |
| | | _gameObject = AssetBundleUtility.Instance.Sync_LoadAsset(_assetInfo) as GameObject; |
| | | } |
| | | |
| | | if (_gameObject == null) |
| | | { |
| | | DesignDebug.LogErrorFormat("InstanceResourcesLoader.LoadSkillEffect() => 加载不到资源: {0}", _effectModel.fxName); |
| | | } |
| | | |
| | | return _gameObject; |
| | | } |
| | | |
| | | |
| | | public static void LoadEffectAsync(int _id, Action<bool, UnityEngine.Object> _callBack) |
| | | { |
| | | GameObject gameObject = null; |
| | | var config = ConfigManager.Instance.GetTemplate<EffectConfig>(_id); |
| | | if (config == null) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | if (AssetSource.effectFromEditor) |
| | | { |
| | | #if UNITY_EDITOR |
| | | string _resourcePath = StringUtility.Contact(ResourcesPath.ResourcesOutAssetPath, |
| | | "Effect/", |
| | | config.packageName, |
| | | "/", |
| | | config.fxName, |
| | | ".prefab"); |
| | | gameObject = AssetDatabase.LoadAssetAtPath<GameObject>(_resourcePath); |
| | | |
| | | if (_callBack != null) |
| | | { |
| | | _callBack(gameObject != null, gameObject); |
| | | } |
| | | #endif |
| | | } |
| | | else |
| | | { |
| | | var bundleName = StringUtility.Contact(ResourcesPath.EFFECT_Folder_Name, config.packageName); |
| | | var assetInfo = new AssetInfo(bundleName, config.fxName); |
| | | AssetBundleUtility.Instance.Co_LoadAsset(assetInfo, _callBack); |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | using UnityEngine;
|
| | | using TableConfig;
|
| | | using System;
|
| | | #if UNITY_EDITOR
|
| | | using UnityEditor;
|
| | | #endif
|
| | |
|
| | | public class InstanceResourcesLoader
|
| | | {
|
| | | public static readonly string raceSuffix = "Prefab_Race_";
|
| | | public static readonly string horseSuffix = "Prefab_Horse_";
|
| | | public static readonly string weaponSuffix = "Prefab_Weapon_";
|
| | | public static readonly string secondarySuffix = "Prefab_Secondary_";
|
| | | public static readonly string handSuffix = "Prefab_Hand_";
|
| | | public static readonly string wingSuffix = "Prefab_Wing_";
|
| | |
|
| | | public static GameObject LoadNpc(int id)
|
| | | {
|
| | | NPCConfig _m = Config.Instance.Get<NPCConfig>(id);
|
| | |
|
| | | if (_m == null || string.IsNullOrEmpty(_m.MODE) || _m.MODE.Equals("0"))
|
| | | {
|
| | | return null;
|
| | | }
|
| | |
|
| | | return LoadModelPrefab(raceSuffix, _m.MODE);
|
| | | }
|
| | |
|
| | | public static RuntimeAnimatorController LoadDefaultMobAnimatorController_Fight()
|
| | | {
|
| | | return AnimatorControllerLoader.LoadMobController(AnimatorControllerLoader.controllerSuffix,
|
| | | GeneralConfig.Instance.ModeDefaultConfig[1][1]);
|
| | | }
|
| | |
|
| | | public static RuntimeAnimatorController LoadDefaultMobAnimatorController_Func()
|
| | | {
|
| | | return AnimatorControllerLoader.LoadMobController(AnimatorControllerLoader.controllerSuffix,
|
| | | GeneralConfig.Instance.ModeDefaultConfig[0][1]);
|
| | | }
|
| | |
|
| | | public static RuntimeAnimatorController LoadDefaultMobAnimatorController_Horse()
|
| | | {
|
| | | return AnimatorControllerLoader.LoadMobController(AnimatorControllerLoader.controllerSuffix,
|
| | | GeneralConfig.Instance.ModeDefaultConfig[3][1]);
|
| | | }
|
| | |
|
| | | public static RuntimeAnimatorController LoadDefaultMobAnimatorController_Pet()
|
| | | {
|
| | | return AnimatorControllerLoader.LoadMobController(AnimatorControllerLoader.controllerSuffix,
|
| | | GeneralConfig.Instance.ModeDefaultConfig[2][1]);
|
| | | }
|
| | |
|
| | | public static GameObject LoadDefaultFightNPC()
|
| | | {
|
| | | return LoadMob(GeneralConfig.Instance.ModeDefaultConfig[1][0],
|
| | | GeneralConfig.Instance.ModeDefaultConfig[1][1]);
|
| | | }
|
| | |
|
| | | public static GameObject LoadDefaultFuncNPC()
|
| | | {
|
| | | return LoadMob(GeneralConfig.Instance.ModeDefaultConfig[0][0],
|
| | | GeneralConfig.Instance.ModeDefaultConfig[0][1]);
|
| | | }
|
| | |
|
| | | public static GameObject LoadDefaultHorse()
|
| | | {
|
| | | return LoadMob(GeneralConfig.Instance.ModeDefaultConfig[3][0],
|
| | | GeneralConfig.Instance.ModeDefaultConfig[3][1]);
|
| | | }
|
| | |
|
| | | public static GameObject LoadDefaultPet()
|
| | | {
|
| | | return LoadMob(GeneralConfig.Instance.ModeDefaultConfig[2][0],
|
| | | GeneralConfig.Instance.ModeDefaultConfig[2][1]);
|
| | | }
|
| | |
|
| | | public static GameObject LoadNpcPrefab(int npcID)
|
| | | {
|
| | | NPCConfig _m = Config.Instance.Get<NPCConfig>(npcID);
|
| | |
|
| | | if (_m == null || _m.MODE.Equals("0"))
|
| | | {
|
| | | return null;
|
| | | }
|
| | |
|
| | | string _assetName;
|
| | | string _assetBundleName;
|
| | |
|
| | | if (GAMgr.Instance.s_NpcID2Assetname.TryGetValue(npcID, out _assetName))
|
| | | {
|
| | | _assetBundleName = GAMgr.Instance.s_NpcID2BundleName[npcID];
|
| | | }
|
| | | else
|
| | | {
|
| | | _assetName = StringUtility.Contact(raceSuffix, _m.MODE);
|
| | | _assetBundleName = StringUtility.Contact(ResourcesPath.MOB_FOLDER_NAME, _assetName);
|
| | | GAMgr.Instance.s_NpcID2Assetname[npcID] = _assetName;
|
| | | GAMgr.Instance.s_NpcID2BundleName[npcID] = _assetBundleName;
|
| | | }
|
| | |
|
| | | return LoadMob(_assetBundleName, _assetName);
|
| | | }
|
| | |
|
| | | public static GameObject LoadModelRes(int id, bool _ui = false)
|
| | | {
|
| | |
|
| | | ModelResConfig _m = Config.Instance.Get<ModelResConfig>(id);
|
| | |
|
| | | if (_m == null)
|
| | | {
|
| | | return null;
|
| | | }
|
| | |
|
| | | string _name = _m.ResourcesName;
|
| | | int _index = _name.IndexOf('/');
|
| | | if (_index != -1)
|
| | | {
|
| | | _name = _name.Substring(_index + 1);
|
| | | }
|
| | |
|
| | | if (_m.Type == (int)E_ModelResType.Suit)
|
| | | {
|
| | | return LoadModelPrefab(raceSuffix, _name, _ui);
|
| | | }
|
| | | else if (_m.Type == (int)E_ModelResType.Horse)
|
| | | {
|
| | | return LoadModelPrefab(horseSuffix, _name, _ui);
|
| | | }
|
| | | else if (_m.Type == (int)E_ModelResType.Wing)
|
| | | {
|
| | | return LoadModelPrefab(wingSuffix, _name, _ui);
|
| | | }
|
| | | else if (_m.Type == (int)E_ModelResType.Weapon)
|
| | | {
|
| | | return LoadModelPrefab(weaponSuffix, _name, _ui);
|
| | | }
|
| | | else if (_m.Type == (int)E_ModelResType.Secondary)
|
| | | {
|
| | | return LoadModelPrefab(secondarySuffix, _name, _ui);
|
| | | }
|
| | | else if (_m.Type == (int)E_ModelResType.Hand)
|
| | | {
|
| | | return LoadModelPrefab(handSuffix, _name, _ui);
|
| | | }
|
| | | return null;
|
| | | }
|
| | |
|
| | |
|
| | | public static void LoadCreateRole(int job, Action<bool, UnityEngine.Object> _callBack)
|
| | | {
|
| | | string _name = "Zs";
|
| | | switch (job)
|
| | | {
|
| | | case 1:
|
| | | _name = "Zs";
|
| | | break;
|
| | | case 2:
|
| | | _name = "Fs";
|
| | | break;
|
| | | case 3:
|
| | | _name = "Zs";
|
| | | break;
|
| | | case 4:
|
| | | _name = "Zs";
|
| | | break;
|
| | | }
|
| | |
|
| | | if (AssetSource.mobFromEditor)
|
| | | {
|
| | | #if UNITY_EDITOR
|
| | | string _resourcePath = StringUtility.Contact(ResourcesPath.ResourcesOutAssetPath,
|
| | | "Mob/CreateRole/",
|
| | | _name,
|
| | | ".prefab");
|
| | |
|
| | | var gameObject = AssetDatabase.LoadAssetAtPath<GameObject>(_resourcePath);
|
| | |
|
| | | if (_callBack != null)
|
| | | {
|
| | | _callBack(true, gameObject);
|
| | | }
|
| | | #endif
|
| | | }
|
| | | else
|
| | | {
|
| | | var assetInfo = new AssetInfo("mob/createrole", _name);
|
| | | AssetBundleUtility.Instance.Co_LoadAsset(assetInfo, _callBack);
|
| | | }
|
| | | }
|
| | |
|
| | | private static GameObject LoadModelPrefab(string _suffix, string name)
|
| | | {
|
| | | GameObject _gameObject = null;
|
| | | if (AssetSource.mobFromEditor)
|
| | | {
|
| | | #if UNITY_EDITOR
|
| | | string _resourcePath = StringUtility.Contact(ResourcesPath.ResourcesOutAssetPath,
|
| | | "Mob/",
|
| | | _suffix + name,
|
| | | ".prefab");
|
| | |
|
| | | _gameObject = AssetDatabase.LoadAssetAtPath<GameObject>(_resourcePath);
|
| | | #endif
|
| | | }
|
| | | else
|
| | | {
|
| | | string _bundleName = StringUtility.Contact(ResourcesPath.MOB_FOLDER_NAME, "prefab_race_" + name.Replace("_UI", ""));
|
| | | string _assetName = _suffix + name;
|
| | | AssetInfo _assetInfo = new AssetInfo(_bundleName, _assetName);
|
| | | _gameObject = AssetBundleUtility.Instance.Sync_LoadAsset(_assetInfo) as GameObject;
|
| | | }
|
| | |
|
| | | if (_gameObject == null)
|
| | | {
|
| | | DebugEx.LogErrorFormat("InstanceResourcesLoader.LoadModel() => 加载不到资源: {0} ", name);
|
| | | }
|
| | |
|
| | | return _gameObject;
|
| | | }
|
| | |
|
| | | private static GameObject LoadModelPrefab(string _suffix, string name, bool _ui)
|
| | | {
|
| | | var prefab = LoadModelPrefab(_suffix, _ui ? name + "_UI" : name);
|
| | | if (prefab == null)
|
| | | {
|
| | | prefab = LoadModelPrefab(_suffix, name);
|
| | | }
|
| | |
|
| | | return prefab;
|
| | | }
|
| | |
|
| | | public static GameObject LoadMob(string assetBundleName, string assetName)
|
| | | {
|
| | | GameObject _gameObject = null;
|
| | | if (AssetSource.mobFromEditor)
|
| | | {
|
| | | #if UNITY_EDITOR
|
| | | string _resourcePath = StringUtility.Contact(ResourcesPath.ResourcesOutAssetPath,
|
| | | "Mob/",
|
| | | assetName,
|
| | | ".prefab");
|
| | |
|
| | | _gameObject = AssetDatabase.LoadAssetAtPath<GameObject>(_resourcePath);
|
| | | #endif
|
| | | }
|
| | | else
|
| | | {
|
| | | _gameObject = AssetBundleUtility.Instance.Sync_LoadAsset(assetBundleName, assetName) as GameObject;
|
| | | }
|
| | |
|
| | | if (_gameObject == null)
|
| | | {
|
| | | DebugEx.LogErrorFormat("InstanceResourcesLoader.LoadModel() => 加载不到资源: {0}/{1} ", assetBundleName, assetName);
|
| | | }
|
| | |
|
| | | return _gameObject;
|
| | | }
|
| | |
|
| | | public static void UnloadAsset(string bundleName, string assetName)
|
| | | {
|
| | | if (!AssetSource.mobFromEditor)
|
| | | {
|
| | | AssetBundleUtility.Instance.UnloadAsset(bundleName, assetName);
|
| | | AssetBundleUtility.Instance.UnloadAssetBundle(bundleName, true, false);
|
| | | }
|
| | | }
|
| | |
|
| | | public static GameObject LoadEffect(int id)
|
| | | {
|
| | | GameObject _gameObject = null;
|
| | |
|
| | | EffectConfig _effectModel = Config.Instance.Get<EffectConfig>(id);
|
| | |
|
| | | if (_effectModel == null)
|
| | | {
|
| | | return null;
|
| | | }
|
| | |
|
| | | if (AssetSource.effectFromEditor)
|
| | | {
|
| | | #if UNITY_EDITOR
|
| | | string _resourcePath = StringUtility.Contact(ResourcesPath.ResourcesOutAssetPath,
|
| | | "Effect/",
|
| | | _effectModel.packageName,
|
| | | "/",
|
| | | _effectModel.fxName,
|
| | | ".prefab");
|
| | | _gameObject = AssetDatabase.LoadAssetAtPath<GameObject>(_resourcePath);
|
| | | #endif
|
| | | }
|
| | | else
|
| | | {
|
| | | string _bundleName = StringUtility.Contact(ResourcesPath.EFFECT_Folder_Name, _effectModel.packageName);
|
| | | AssetInfo _assetInfo = new AssetInfo(_bundleName, _effectModel.fxName);
|
| | | _gameObject = AssetBundleUtility.Instance.Sync_LoadAsset(_assetInfo) as GameObject;
|
| | | }
|
| | |
|
| | | if (_gameObject == null)
|
| | | {
|
| | | DebugEx.LogErrorFormat("InstanceResourcesLoader.LoadSkillEffect() => 加载不到资源: {0}", _effectModel.fxName);
|
| | | }
|
| | |
|
| | | return _gameObject;
|
| | | }
|
| | |
|
| | |
|
| | | public static void LoadEffectAsync(int _id, Action<bool, UnityEngine.Object> _callBack)
|
| | | {
|
| | | GameObject gameObject = null;
|
| | | var config = Config.Instance.Get<EffectConfig>(_id);
|
| | | if (config == null)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | if (AssetSource.effectFromEditor)
|
| | | {
|
| | | #if UNITY_EDITOR
|
| | | string _resourcePath = StringUtility.Contact(ResourcesPath.ResourcesOutAssetPath,
|
| | | "Effect/",
|
| | | config.packageName,
|
| | | "/",
|
| | | config.fxName,
|
| | | ".prefab");
|
| | | gameObject = AssetDatabase.LoadAssetAtPath<GameObject>(_resourcePath);
|
| | |
|
| | | if (_callBack != null)
|
| | | {
|
| | | _callBack(gameObject != null, gameObject);
|
| | | }
|
| | | #endif
|
| | | }
|
| | | else
|
| | | {
|
| | | var bundleName = StringUtility.Contact(ResourcesPath.EFFECT_Folder_Name, config.packageName);
|
| | | var assetInfo = new AssetInfo(bundleName, config.fxName);
|
| | | AssetBundleUtility.Instance.Co_LoadAsset(assetInfo, _callBack);
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | }
|