Pryme8 Posted October 6, 2016 Share Posted October 6, 2016 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 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted October 7, 2016 Share Posted October 7, 2016 it should not and I don't see why you need a reset. this must be related to your recursive code but I can't tell more without a repro Pryme8 1 Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted October 7, 2016 Author Share Posted October 7, 2016 When I'm done with the project I'll post the a likeness of the script that does it, it was pretty interesting and the work around of the reset made little logic to me, but hey if something works don't break it right? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted October 7, 2016 Share Posted October 7, 2016 correct:) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.