Jump to content

Asset Manager, Redundant Assets Loading


Pryme8
 Share

Recommended Posts

I have a recursive loop loading assets and presenting them in a preloader fashion in a scene that I am deploying.  Initially when I was only loading one element of my array at a time to troubleshoot I did not notice, but once I started doing more then one item in my array, It redid all the requests prior to it, so after 48 objects my item count was like 9k, not like 116 which was anticipated.

I noticed that the callback to the onSuccess redid all the other tasks prior to it in addition to the one that finished.  My variable hierarchy was correct and so was the rest of the script, I would post the script to show and demonstrate but as this is a paid project I am unable to share proprietary information. 

Alas I found a workaround and fixed it but I feel like this is should be unnecessary.

 

...
setTimeout(function(){self._buildPresets(list,c);},200);
			
		};
		
		
		this.loader.load();
		this.loader.reset();
...

Resetting the loader tasks after each load seemed to do the trick, but in my mind the order of operations and execution stack this working does not make any since to me... but it works so I'm not complaining.

Why do I need to reset the task list? shouldn't after completion and no Errors the task drop automatically from the stack?

Alerting @Deltakosh

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...