Best place to initialize some utility classes

Best place to initialize some utility classes


Greetings. This question is towards best practices or, at least, some hint from more experienced developers.

I have some utility classes (singletons written in Typescript) that have initialize() methods which do some specific tasks. One of these tasks loads Json files from the resource folder. One of these Json files contains configurations that affects all the scenes behavior and appearance.

My question is: where is the best place to call these initialization() methods? Is there a better place before the start() method of the first scene? Notice, however, that the resources should already be available for consuming by the classes.

Thank you all in advance.


i have a preloader scene. there i initialize everything like json data san savegames and make my nodes of interest persistent. then i load the main menu/map and levels


That is one solution but this preloader is something like a splash screen?


is a scene. so i put a small animated background while is loading before change the next scene.
The idea is that preloader is a scene that should be called only on first load


Thank you. Maybe I can adapt your idea.

I was just wondering if there is any place that is not in a scene and yet can be used to initialize these classes to consume the resources.