瀏覽代碼

Fix C# ChangeScene Method Name in Scene Tree tutorial.

DeadlyEssence01 2 年之前
父節點
當前提交
9bc011a1df
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      tutorials/scripting/scene_tree.rst

+ 2 - 2
tutorials/scripting/scene_tree.rst

@@ -154,7 +154,7 @@ function:
 
 
     public void _MyLevelWasCompleted()
     public void _MyLevelWasCompleted()
     {
     {
-        GetTree().ChangeScene("res://levels/level2.tscn");
+        GetTree().ChangeSceneToFile("res://levels/level2.tscn");
     }
     }
 
 
 Rather than using file paths, one can also use ready-made
 Rather than using file paths, one can also use ready-made
@@ -175,7 +175,7 @@ function
     public void _MyLevelWasCompleted()
     public void _MyLevelWasCompleted()
     {
     {
         var nextScene = (PackedScene)ResourceLoader.Load("res://levels/level2.tscn");
         var nextScene = (PackedScene)ResourceLoader.Load("res://levels/level2.tscn");
-        GetTree().ChangeSceneTo(nextScene);
+        GetTree().ChangeSceneToPacked(nextScene);
     }
     }
 
 
 These are quick and useful ways to switch scenes but have the drawback
 These are quick and useful ways to switch scenes but have the drawback