protected void LoadMesh() { m_MeshHolder = null; ResLoader loader = ResLoader.Allocate(null); loader.Add2Load(m_MeshHolderName, OnMeshLoadResult); if (m_PreLoader != null) { m_PreLoader.Recycle2Cache(); m_PreLoader = null; } m_PreLoader = m_Loader; m_Loader = loader; if (m_AsyncLoad) { m_Loader.LoadAsync(); } else { m_Loader.LoadSync(); } }
protected void OnMeshLoadResult(bool result, IRes res) { if (result) { MeshHolder holder = res.asset as MeshHolder; if (holder != null) { mesh = holder.Find(m_MeshName); } } if (m_PreLoader != null) { m_PreLoader.Recycle2Cache(); m_PreLoader = null; } }