コード例 #1
0
 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");
     }
 }
コード例 #2
0
 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");
     }
 }
コード例 #3
0
 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");
     }
 }
コード例 #4
0
 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");
     }
 }
コード例 #5
0
        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);
            }
            }
        }
コード例 #6
0
 bool TryLoad(LoaderObject lo)
 {
     if (this.activeLoaderObjects.Count < this.maxConcurrentLoads)
     {
         lo.Load();
         this.activeLoaderObjects.Add(lo);
         return(true);
     }
     else
     {
         return(false);
     }
 }
コード例 #7
0
        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);
                }
            }
        }
コード例 #8
0
        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);
            }
        }
コード例 #9
0
 virtual public void SetLoaderObject(LoaderObject loader)
 {
 }
コード例 #10
0
 /// Comparison function for removing finished LoaderObjects with .RemoveWhere()
 bool LoaderDone(LoaderObject lo)
 {
     return(lo.IsLoaded() || lo.IsNotFound());
 }
コード例 #11
0
 public override void SetLoaderObject(LoaderObject loader)
 {
     throw new System.NotImplementedException ();
 }
コード例 #12
0
 bool TryLoad(LoaderObject lo)
 {
     if (this.activeLoaderObjects.Count < this.maxConcurrentLoads) {
     lo.Load();
     this.activeLoaderObjects.Add (lo);
     return true;
     } else {
     return false;
     }
 }
コード例 #13
0
 /// Comparison function for removing finished LoaderObjects with .RemoveWhere()
 bool LoaderDone(LoaderObject lo)
 {
     return (lo.IsLoaded() || lo.IsNotFound());
 }
コード例 #14
0
 public override void SetLoaderObject(LoaderObject loader)
 {
     throw new System.NotImplementedException();
 }