Hello,
I am looking for a simple way to keep track of loaded assets (their names). To this end, I introduced cLoader manager class that records asset names on successful load -
cLoader has loadedMeshNames array data member and, on successful load, the new mesh name is appended to this array.
Thus if I want to keep track of a particular mesh, for example, I can load the mesh through this class. Here is my playground
Unfortunately, that does not work because I am getting an error in the callback for onSuccess load.
In console, you can see following error
logger.ts:103 BJS - [16:17:25]: Unable to load from https://assets.babylonjs.com/meshes/Yeti/MayaExport/glTF/Yeti.gltf: Error in onSuccess callback: TypeError: Cannot read properties of undefined (reading ‘loadedMeshNames’)
For some reason, I cannot access the data member in my class’ method.
Any suggestion, what would be the optimum way for me to keep track of loaded assets, so I can destroy, hide, unhide them as needed?
Thank you