v0.3: Entity Singleton Feature
Fixes #2
Added the Entity Singleton feature. It's an easy way to keep track of important Nodes that only exist once in your scenes (like your player or your level tilemap), regardless of the name they have.
func get_entity(entity_name: String)
Get a reference to a named entity (node) in your scene. To define entity names go to the desired node in the editor inspector and you'll see two new properties: Singleton entity and Entity name. Check the Singleton entity checkbox to have this node saved to the SceneManager entity dictionary and write a friendly Entity name to be used in this function. Afterwards, you'll be able to access it within the scene.
NOTE: If accessing the node in a _ready() method within your scene, get_entity will throw an error. This is because saving the entities to the SceneManager requires the scene to be completely loaded, which hasn't happened yet in the _ready() method. To circumvent this problem, you will have to wait until the scene is completely loaded. To do this, you can take advantage of the scene_loaded signal provided by SceneManager, like so:
yield(SceneManager, "scene_loaded")
Player = SceneManager.get_entity("Player")