/// <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; Recycle(); }
/// <summary> /// 引用次数为0处理 /// </summary> protected override void OnZeroRef() { if (m_asset != null) { if (m_asset is GameObject) { } else { Resources.UnloadAsset(m_asset); } } if (m_bundleRes != null) { m_bundleRes.Unload(); m_bundleRes = null; } m_assetBundle = null; m_asset = null; Recycle(); }