SceneCache

Extends: Node

Description

A rolling cache to preload scenes for a better performance Uses the ResourceQueue as described in the Godot documentation

Method Descriptions

_init

func _init(cache_count: int, scene_path: String, scene_regex: String, permanent_cache: PoolStringArray)

update_progress

func update_progress()

Update the current progress on the waiting screen and emit the queue_complete signal when we’re done

get_scene

func get_scene(path: String) -> PackedScene

Retrieve a scene from the cache. If the scene wasn’t already cached, this function will wait for it to be cached.

** Parameters **

  • path: The path to the scene

update_cache

func update_cache(current_scene: String) -> int

Update the cache. Start caching new scenes and remove scenes, that are not used anymore

** Parameters **

  • current_scene: The path and filename of the current scene Returns Number of cached scenes

Signals

  • signal queue_complete(): All pending resources were loaded