瀏覽代碼

Update `instance()` call to `instantiate()` in Making Plugins (#5917)

Loki McKay 3 年之前
父節點
當前提交
c9da1e8a37
共有 1 個文件被更改,包括 3 次插入3 次删除
  1. 3 3
      tutorials/plugins/editor/making_plugins.rst

+ 3 - 3
tutorials/plugins/editor/making_plugins.rst

@@ -326,8 +326,8 @@ The script could look like this:
 
     func _enter_tree():
         # Initialization of the plugin goes here.
-        # Load the dock scene and instance it.
-        dock = preload("res://addons/my_custom_dock/my_dock.tscn").instance()
+        # Load the dock scene and instantiate it.
+        dock = preload("res://addons/my_custom_dock/my_dock.tscn").instantiate()
 
         # Add the loaded scene to the docks.
         add_control_to_dock(DOCK_SLOT_LEFT_UL, dock)
@@ -354,7 +354,7 @@ The script could look like this:
 
         public override void _EnterTree()
         {
-            dock = (Control)GD.Load<PackedScene>("addons/my_custom_dock/my_dock.tscn").Instance();
+            dock = (Control)GD.Load<PackedScene>("addons/my_custom_dock/my_dock.tscn").Instantiate();
             AddControlToDock(DockSlot.LeftUl, dock);
         }