public void Init(string bundleName, string assetName, ResNotificationListener listener) { m_only = string.IsNullOrEmpty(assetName); m_bundleRes = ResPoolSystem.Get <BundleRes>(ResData.AllocateBundle(bundleName), true); if (!m_only) { m_assetRes = ResPoolSystem.Get <AssetRes>(ResData.AllocateAsset(assetName, bundleName), true); } m_listener = listener; }
/// <summary> /// 卸载资源 /// </summary> public override void Unload() { if (m_bundleRes != null) { m_bundleRes.RemoveNotification(OnReceiveNotification); m_bundleRes.Unload(); m_bundleRes = null; } if (m_assetRes != null) { m_assetRes.RemoveNotification(OnReceiveNotification); m_assetRes.Unload(); m_assetRes = null; } m_listener = null; Recycle2Cache(); }