public override void ClearAllResources() { if (!m_IsAppQuit) { var mgr = BaseResLoaderAsyncMgr.GetInstance(); if (mgr != null) { mgr.RemoveListener(this); } // 回池 if (m_LoadingList != null) { var node = m_LoadingList.First; while (node != null) { var next = node.Next; if (node.Value != null) { node.Value.Dispose(); } node = next; } m_LoadingList.Clear(); } } base.ClearAllResources(); }
public bool LoadMainTextureAsync(string fileName, MeshRenderer renderer, bool isMatInst = false, int loadPriority = 0) { if (renderer == null) { return(false); } var mgr = BaseResLoaderAsyncMgr.GetInstance(); if (mgr != null) { ulong id; int rk = ReMake(fileName, renderer, BaseResLoaderAsyncType.MeshRenderMainTexture, isMatInst, out id, _cMainTex); if (rk < 0) { return(false); } if (rk == 0) { return(true); } return(mgr.LoadTextureAsync(fileName, this, id, loadPriority)); } return(false); }
public bool LoadAniControllerAsync(string fileName, Animator obj, int loadPriority = 0) { if (obj == null) { return(false); } var mgr = BaseResLoaderAsyncMgr.GetInstance(); if (mgr != null) { ulong id; int rk = ReMake(fileName, obj, BaseResLoaderAsyncType.AnimatorController, false, out id); if (rk < 0) { return(false); } if (rk == 0) { return(true); } return(mgr.LoadAniControllerAsync(fileName, this, id, loadPriority)); } return(false); }
protected virtual void Awake() { m_UUID = ++m_GlobalUUID; var mgr = BaseResLoaderAsyncMgr.GetInstance(); if (mgr != null) { mgr.RegListener(this); } }
public bool LoadMaterialAsync(string fileName, MeshRenderer renderer, int loadPriority = 0) { if (renderer == null) { return(false); } var mgr = BaseResLoaderAsyncMgr.GetInstance(); if (mgr != null) { Material target; if (ExitsResKeyTag <Material> (renderer, fileName, out target)) { if (renderer.sharedMaterial == null) { renderer.sharedMaterial = target; ClearInstanceMaterialMap(renderer); } return(true); } ulong id; int rk = ReMake(fileName, renderer, BaseResLoaderAsyncType.MeshRenderMaterial, false, out id); if (rk < 0) { return(false); } if (rk == 0) { return(true); } return(mgr.LoadMaterialAsync(fileName, this, id, loadPriority)); } return(false); }