Document ResourceLoader load() CacheModes #8434
Labels
area:class reference
Issues and PRs about the class reference, which should be addressed on the Godot engine repository
enhancement
Your Godot version:
4.2 beta 5
Issue description:
I was trying to figure out more precisely how load() would create new instances of the loaded resource or reuse already loaded instances. I think it's controlled by the optional cachemode parameter(?). However, this feels like an important and useful feature so it would be good if this was explained more explicitly. For example (my additions in italics if my guesses are correct?):
enum CacheMode:
CacheMode CACHE_MODE_IGNORE = 0
Load a new instance from path, regardless if loaded instance already exists in cache.
CacheMode CACHE_MODE_REUSE = 1
Reuse already loaded instance from cache if one exists, otherwise load a new instance.
CacheMode CACHE_MODE_REPLACE = 2
Load a new instance from path and replace the currently cached instance if one exists.
URL to the documentation page (if already existing):
https://docs.godotengine.org/en/stable/classes/class_resourceloader.html#enum-resourceloader-cachemode
The text was updated successfully, but these errors were encountered: