Class AssetManager
java.lang.Object
dev.engine.core.asset.AssetManager
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddSource(int index, AssetSource source) voidaddSource(AssetSource source) voidenableHotReload(Path watchDir) Enables hot-reload by watching the given directory for file changes.void<T> CompletableFuture<T> <T> T<T> voidvoidregisterLoader(AssetLoader<?> loader) voidreloadChanged(String path) voidshutdown()Shuts down the asset manager, stopping the file watcher if active.voidwatchForReload(String path) Registers a file for hot-reload watching.
-
Constructor Details
-
AssetManager
-
-
Method Details
-
addSource
-
addSource
-
registerLoader
-
loadSync
-
loadAsync
-
evict
-
onReload
-
reloadChanged
-
enableHotReload
Enables hot-reload by watching the given directory for file changes. When a watched file is modified, it is evicted from cache, reloaded, and all registered onReload callbacks are fired. -
watchForReload
Registers a file for hot-reload watching. When the file changes, the cache is evicted and the asset is reloaded, firing callbacks. -
shutdown
public void shutdown()Shuts down the asset manager, stopping the file watcher if active.
-