InstancePlaceholder¶
类别: 核心
简要说明¶
根的占位符 Node A的 PackedScene .
方法¶
create_instance ( bool replace=false, PackedScene custom_scene=null ) |
|
get_instance_path ( ) const |
|
get_stored_values ( bool with_order=false ) |
|
无效 |
replace_by_instance ( PackedScene custom_scene=null ) |
描述¶
打开选项 加载为占位符 对于编辑器中的实例场景,在运行游戏时会将其替换为InstancePlaceholder。这样可以延迟实际加载场景,直到调用 replace_by_instance . 这有助于避免同时加载大型场景,方法是有选择地加载部分场景。
InstancePlaceholder没有转换。这将导致任何子节点相对于视窗从点(0,0)定位,而不是在编辑器中显示的父节点。将占位符替换为带有转换的场景将再次相对地将子对象转换为父对象。
方法说明¶
Node create_instance ( bool replace=false, PackedScene custom_scene=null )
String get_instance_path ( ) const
获取到的路径 PackedScene 调用时默认加载的资源文件 replace_by_instance .
Dictionary get_stored_values ( bool with_order=false )
void replace_by_instance ( PackedScene custom_scene=null )
将此占位符替换为作为参数传递的场景,如果未提供参数,则替换原始场景。对于所有资源,只有在场景尚未加载时才加载。通过预先手动加载场景,可以避免此功能造成的延迟。