I was trying out an application which needed some library JS files. But didn’t get an expected result. I read somewhere on the forum to create a new script in the editor itself and copy paste the library content and place in “Script Order”. But no luck. (I had asked this question in answers.playcanvas.com - http://answers.playcanvas.com/questions/3025/script-loading-order-error). However, I found the scripts to come in order when I attach them to an entity. All worked great till now.
(I noticed the new editor updates the scene on script update - Great feature though).
Now when I try to update a particular script, it comes to the top of the order as seen in Inspector(Chrome 51) which eventually generates errors in run-time. Would be great if somebody could help me out with the process of script execution order or on how playcanvas handles it. Any kind of help is truly appreciated.
PS: Loading Order in the old editor is working fine. Problems only with the new editor
Load order is not related to the order/when the initialize function is called.
If you put a console.log at the top of each file, you should see that they are loaded in the correct order. The order that the initialize function is called is dependent on the entity hierarchy and when entities are enabled.