module Godot::AutoloadManager

Overview

Manages the lifecycle, Engine singleton registration, SceneTree root mounting, and hot-reload teardown for all user-defined @[Autoload] nodes.

Extended Modules

Defined in:

libgodot/autoload.cr

Instance Method Summary

Instance Method Detail

def [](name : String) : Record #

Returns the autoload Record for the given name, or raises KeyError if not registered


def []?(name : String) : Record | Nil #

Returns the autoload Record for the given name, or nil if not registered


def has_autoload?(name : String) : Bool #

Returns true if an autoload record exists for the given name


def mount_to_tree(target_tree : SceneTree | Nil = nil) : Void #

Mounts any pending autoload nodes to the SceneTree root (/root/) if not already mounted.


def mounted? : Bool #

Returns true if all registered autoload nodes requiring SceneTree mounting have been mounted


def records : Array(Record) #

Returns all active autoload records


def setup_autoloads : Void #

Initializes and instantiates all registered @[Autoload] classes. Registers each node with Godot's Engine singleton registry (if singleton: true) and sets the typed Class.instance accessor.


def size : Int32 #

Returns the total count of registered autoload nodes


def teardown_autoloads : Void #

Tears down all autoload nodes: unregisters them from Engine, removes them from SceneTree, clears references, and ensures no dead-pointer or DLL unload crashes occur.