public ImageCacher(ILocalImageCache localRunner) { this.localRunner = localRunner; LocalStorageRunner.QueueSpeed queueSpeed = this.GetQueueSpeed(); this.localRunner.Init(queueSpeed); ImageCacher.UnloaderType unloaderType = this.GetUnloaderType(); FMLogger.vCore(string.Concat(new object[] { "buffer type: ", unloaderType, " queue speed: ", queueSpeed })); switch (unloaderType) { case ImageCacher.UnloaderType.LowEnd: this.unloader = new LowEndUnloadBehaviour(this.cached, localRunner); break; case ImageCacher.UnloaderType.MidEnd: this.unloader = new MidEndUnloadBehaviour(this.cached, localRunner); break; case ImageCacher.UnloaderType.HighEnd: this.unloader = new HighEndUnloadBehaviour(this.cached, localRunner); break; default: this.unloader = new LowEndUnloadBehaviour(this.cached, localRunner); break; } }
public void Init(LocalStorageRunner.QueueSpeed queueSpeed = LocalStorageRunner.QueueSpeed.Slow) { if (queueSpeed != LocalStorageRunner.QueueSpeed.Slow) { if (queueSpeed != LocalStorageRunner.QueueSpeed.Medium) { if (queueSpeed == LocalStorageRunner.QueueSpeed.Fast) { this.queue = new FastQueueRunner(new Func <IEnumerator, Coroutine>(base.StartCoroutine)); } } else { this.queue = new MediumQueueRunner(new Func <IEnumerator, Coroutine>(base.StartCoroutine)); } } else { this.queue = new SlowQueueRunner(); } FMLogger.vCore("queue speed " + queueSpeed); this.processorCoroutine = base.StartCoroutine(this.queue.QueueProcessor()); }