GDExtensionManager
继承: Object
Provides access to GDExtension functionality.
描述
The GDExtensionManager loads, initializes, and keeps track of all available GDExtension
libraries in the project.
Note: Do not worry about GDExtension unless you know what you are doing.
方法
GDExtension | get_extension ( path: String ) |
PackedStringArray | get_loaded_extensions ( ) const1 |
bool | is_extension_loaded ( path: String ) const1 |
LoadStatus | load_extension ( path: String ) |
LoadStatus | reload_extension ( path: String ) |
LoadStatus | unload_extension ( path: String ) |
信号
extension_loaded ( extension: GDExtension
)
Emitted after the editor has finished loading a new extension.
Note: This signal is only emitted in editor builds.
extension_unloading ( extension: GDExtension
)
Emitted before the editor starts unloading an extension.
Note: This signal is only emitted in editor builds.
extensions_reloaded ( )
Emitted after the editor has finished reloading one or more extensions.
枚举
enum LoadStatus:
LoadStatus LOAD_STATUS_OK = 0
The extension has loaded successfully.
LoadStatus LOAD_STATUS_FAILED = 1
The extension has failed to load, possibly because it does not exist or has missing dependencies.
LoadStatus LOAD_STATUS_ALREADY_LOADED = 2
The extension has already been loaded.
LoadStatus LOAD_STATUS_NOT_LOADED = 3
The extension has not been loaded.
LoadStatus LOAD_STATUS_NEEDS_RESTART = 4
The extension requires the application to restart to fully load.
方法说明
GDExtension
get_extension ( path: String
)
Returns the GDExtension
at the given file path
, or null
if it has not been loaded or does not exist.
PackedStringArray
get_loaded_extensions ( ) const1
Returns the file paths of all currently loaded extensions.
bool
is_extension_loaded ( path: String
) const1
Returns true
if the extension at the given file path
has already been loaded successfully. See also get_loaded_extensions
.
LoadStatus load_extension ( path: String
)
Loads an extension by absolute file path. The path
needs to point to a valid GDExtension
. Returns LOAD_STATUS_OK
if successful.
LoadStatus reload_extension ( path: String
)
Reloads the extension at the given file path. The path
needs to point to a valid GDExtension
, otherwise this method may return either LOAD_STATUS_NOT_LOADED
or LOAD_STATUS_FAILED
.
Note: You can only reload extensions in the editor. In release builds, this method always fails and returns LOAD_STATUS_FAILED
.
LoadStatus unload_extension ( path: String
)
Unloads an extension by file path. The path
needs to point to an already loaded GDExtension
, otherwise this method returns LOAD_STATUS_NOT_LOADED
.
本方法通常需要用户覆盖才能生效。
本方法无副作用,不会修改该实例的任何成员变量。
本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。
本方法用于构造某个类型。
调用本方法无需实例,可直接使用类名进行调用。
本方法描述的是使用本类型作为左操作数的有效运算符。
这个值是由下列位标志构成位掩码的整数。
无返回值。