I created a custom class that I want to handle all my asset loading and to store things like the file paths, etc.
The way I’m using it right now, it’s instantiated in the core World class and then passed down to classes that need it with the following method:
class MyClass:
def __init__(self, assetLoader):
self.assetLoader = assetLoader
My hope and belief is that this results in a single instance of the assetLoader class in memory, and all the classes that I have passed it to possess a reference to that same assetLoader. When I use self.assetLoader in any of them, it all points to the same object in memory.
That is how it works, right?