public void Clear() { if (this.m_resourceManager == null) { AssetLogger.Error("null == m_resourceManager"); return; } this.m_resourceManager.Clear(); }
/// <summary> /// 根据名字取得有引用的资源 /// </summary> /// <param name="name"></param> /// <returns></returns> private CollectDepResourceData GetCollectDepResourceData(string name) { CollectDepResourceData result = null; if (!this.mDicCollectDepResourceData.TryGetValue(name, out result)) { AssetLogger.Error(string.Format("mDicCollectDepResourceData.TryGetValue(name, out collectDepResourceData) == false:{0}", name)); } return(result); }
/// <summary> /// 通过Resources加载资源 /// </summary> /// <param name="strAssetFile"></param> /// <returns></returns> public UnityEngine.Object Load(string strAssetFile) { UnityEngine.Object @object = null; if (!string.IsNullOrEmpty(strAssetFile)) { @object = Resources.Load(strAssetFile); } if (null == @object) { AssetLogger.Error("null == obj: " + strAssetFile); } Resources.UnloadUnusedAssets(); return(@object); }
public void Update() { try { if (this.m_resourceManager != null) { this.m_resourceManager.OnUpdate(); } } catch (Exception ex) { AssetLogger.Fatal(ex.ToString()); } }
/// <summary> /// 初始化资源管理器 /// </summary> /// <param name="editorResourceManager"></param> public void Init(IResourceManager editorResourceManager) { if ((RuntimePlatform.WindowsEditor == Application.platform || Application.platform == RuntimePlatform.OSXEditor || Application.platform == RuntimePlatform.WindowsPlayer) && editorResourceManager != null) { this.m_resourceManager = editorResourceManager; //this.m_resourceManager = ResourceFactory.GetResourceManager(); } if (this.m_resourceManager == null) { this.m_resourceManager = ResourceFactory.GetResourceManager(); } if (this.m_resourceManager != null) { this.m_resourceManager.Init(ResourceManager.GetFullPath("", false), ResourceManager.GetFullPath("", true)); return; } AssetLogger.Error("null == m_resourceManager"); }
public IAssetRequest LoadEffect(string relativeUrl, AssetRequestFinishedEventHandler callBackFun, AssetPRI assetPRIType) { if (this.m_resourceManager == null) { AssetLogger.Error("null == m_resourceManager"); return(null); } IAssetRequest result = null; try { result = this.m_resourceManager.LoadEffect(relativeUrl, callBackFun, assetPRIType); } catch (Exception ex) { AssetLogger.Fatal(ex.ToString()); } return(result); }
public IAssetRequest CreateAssetRequest(string strCompleteUrl, AssetRequestFinishedEventHandler callBackFun, AssetPRI assetPRIType, EnumAssetType eAssetType) { if (this.m_resourceManager == null) { AssetLogger.Error("null == m_resourceManager"); return(null); } IAssetRequest result = null; try { result = this.m_resourceManager.CreateAssetRequest(strCompleteUrl, callBackFun, assetPRIType, eAssetType); } catch (Exception ex) { AssetLogger.Fatal(ex.ToString()); } return(result); }
public IAssetRequest LoadScene(string relativeUrl, AssetRequestFinishedEventHandler callBackFun, AssetPRI assetPRIType) { IAssetRequest result; if (null == this.m_resourceManager) { AssetLogger.Error("null == m_resourceManager"); result = null; } else { IAssetRequest assetRequest = null; try { assetRequest = this.m_resourceManager.LoadScene(relativeUrl, callBackFun, assetPRIType); } catch (Exception ex) { AssetLogger.Fatal(ex.ToString()); } result = assetRequest; } return(result); }
public static void SetLog(IXLog log) { AssetLogger.Init(log); }