瀏覽代碼

Mention that change_scene is deferred

kobewi 4 年之前
父節點
當前提交
86aa9b1233
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      doc/classes/SceneTree.xml

+ 2 - 0
doc/classes/SceneTree.xml

@@ -45,6 +45,7 @@
 			<description>
 			<description>
 				Changes the running scene to the one at the given [code]path[/code], after loading it into a [PackedScene] and creating a new instance.
 				Changes the running scene to the one at the given [code]path[/code], after loading it into a [PackedScene] and creating a new instance.
 				Returns [constant OK] on success, [constant ERR_CANT_OPEN] if the [code]path[/code] cannot be loaded into a [PackedScene], or [constant ERR_CANT_CREATE] if that scene cannot be instantiated.
 				Returns [constant OK] on success, [constant ERR_CANT_OPEN] if the [code]path[/code] cannot be loaded into a [PackedScene], or [constant ERR_CANT_CREATE] if that scene cannot be instantiated.
+				[b]Note:[/b] The scene change is deferred, which means that the new scene node is added on the next idle frame. You won't be able to access it immediately after the [method change_scene] call.
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="change_scene_to">
 		<method name="change_scene_to">
@@ -55,6 +56,7 @@
 			<description>
 			<description>
 				Changes the running scene to a new instance of the given [PackedScene].
 				Changes the running scene to a new instance of the given [PackedScene].
 				Returns [constant OK] on success or [constant ERR_CANT_CREATE] if the scene cannot be instantiated.
 				Returns [constant OK] on success or [constant ERR_CANT_CREATE] if the scene cannot be instantiated.
+				[b]Note:[/b] The scene change is deferred, which means that the new scene node is added on the next idle frame. You won't be able to access it immediately after the [method change_scene_to] call.
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="create_timer">
 		<method name="create_timer">