Пример #1
0
        public void Init(string bundleName, string assetName, ResNotificationListener listener)
        {
            m_only = string.IsNullOrEmpty(assetName);

            m_bundleRes = ResPool.Get <BundleRes>(ResData.AllocateBundle(bundleName), true);

            if (!m_only)
            {
                m_assetRes = ResPool.Get <AssetRes>(ResData.AllocateAsset(assetName, bundleName), true);
            }

            m_listener = listener;
        }
Пример #2
0
        /// <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();
        }