public void SetLoaderObject(LoaderObject loader) { this.filePath = loader.GetFilePath(); oggLoader = loader as SoundLoaderObject; if (oggLoader == null) { Debug.LogError("Loader for " + this.filePath + " is not an OggSoundLoaderObject"); } }
public override void SetLoaderObject(LoaderObject loader) { this.filePath = loader.GetFilePath(); imageLoader = loader as ImageLoaderObject; if (imageLoader == null) { Debug.LogError("Loader for " + this.filePath + " is not an ImageLoaderObject"); } }
public void AddLoaderInfo(LoaderObject loaderObj, bool frontOfQueue = false) { // Start loading straight away if we haven't reached our limit, or put it in the queue bool loadOk = this.TryLoad(loaderObj); if (!loadOk) { if (!frontOfQueue) { workQueue.AddLast(loaderObj); } else { workQueue.AddFirst(loaderObj); } } }
bool TryLoad(LoaderObject lo) { if (this.activeLoaderObjects.Count < this.maxConcurrentLoads) { lo.Load(); this.activeLoaderObjects.Add(lo); return(true); } else { return(false); } }
public void Update() { // Go through queue of stuff that still needs to be loaded if (workQueue.Count > 0) { LoaderObject loader = workQueue.First.Value; if (TryLoad(loader)) { workQueue.RemoveFirst(); } } foreach (LoaderObject lo in this.activeLoaderObjects) { lo.Update(); } // Check loaders to see if they are done and remove them from the active set if (this.activeLoaderObjects.Count > 0) { this.activeLoaderObjects.RemoveWhere(LoaderDone); } }
virtual public void SetLoaderObject(LoaderObject loader) { }
/// Comparison function for removing finished LoaderObjects with .RemoveWhere() bool LoaderDone(LoaderObject lo) { return(lo.IsLoaded() || lo.IsNotFound()); }
public override void SetLoaderObject(LoaderObject loader) { throw new System.NotImplementedException (); }
bool TryLoad(LoaderObject lo) { if (this.activeLoaderObjects.Count < this.maxConcurrentLoads) { lo.Load(); this.activeLoaderObjects.Add (lo); return true; } else { return false; } }
/// Comparison function for removing finished LoaderObjects with .RemoveWhere() bool LoaderDone(LoaderObject lo) { return (lo.IsLoaded() || lo.IsNotFound()); }
public override void SetLoaderObject(LoaderObject loader) { throw new System.NotImplementedException(); }