/// <summary>
 /// Shut down.
 /// </summary>
 public void ShutDown()
 {
     m_DownloadTaskRawPool.Clear();
     m_DownloadTaskRawPool = null;
     RefPoolModule         = null;
     DownloadModule        = null;
 }
Exemple #2
0
 public void SetUp()
 {
     m_RefPool = (RefPool <PoolableObject>)Activator.CreateInstance(typeof(RefPool <PoolableObject>),
                                                                    BindingFlags.NonPublic | BindingFlags.Instance,
                                                                    null, new object[] { InitCapacity }, CultureInfo.InvariantCulture);
     PoolableObject.CurrentIndex = 0;
 }
        /// <summary>
        /// Initialize.
        /// </summary>
        public void Init()
        {
            m_DownloadTaskRawPool = RefPoolModule.GetOrAdd <DownloadTask>();
            if (m_DownloadTaskRawPool != null)
            {
                return;
            }

            m_DownloadTaskRawPool = RefPoolModule.Add <DownloadTask>(DownloadModule.ConcurrentDownloadCountLimit);
            m_DownloadTaskRawPool.ApplyCapacity();
        }
Exemple #4
0
 internal Loader(AssetService owner)
 {
     m_Owner = owner;
     m_RunningAssetLoadingTasks =
         new List <IAssetLoadingTaskImpl>(ConcurrentAssetLoaderCount > 0 ? ConcurrentAssetLoaderCount : 16);
     m_RunningResourceLoadingTasks =
         new List <IResourceLoadingTaskImpl>(ConcurrentResourceLoaderCount > 0 ? ConcurrentResourceLoaderCount : 8);
     m_AssetCachePool          = m_Owner.RefPoolService.Add <AssetCache>(owner.AssetCachePoolCapacity);
     m_ResourceCachePool       = m_Owner.RefPoolService.Add <ResourceCache>(owner.ResourceCachePoolCapacity);
     m_AssetAccessorPool       = m_Owner.RefPoolService.Add <AssetAccessor>(m_Owner.AssetAccessorPoolCapacity);
     m_AssetLoadingTaskPool    = m_Owner.RefPoolService.Add <AssetLoadingTask>(m_RunningAssetLoadingTasks.Capacity);
     m_ResourceLoadingTaskPool = m_Owner.RefPoolService.Add <ResourceLoadingTask>(m_RunningResourceLoadingTasks.Capacity);
     //m_DFSVisitedFlags = new HashSet<string>();
     m_AssetAccessorsToRelease = new List <AssetAccessor>(m_Owner.AssetAccessorPoolCapacity / 8);
 }
Exemple #5
0
 public void TearDown()
 {
     m_RefPool.Clear();
     m_RefPool = null;
 }