mirror of
https://github.com/godotengine/godot-docs.git
synced 2026-01-03 05:48:42 +03:00
Fix C# ChangeScene Method Name in Scene Tree tutorial.
This commit is contained in:
@@ -154,7 +154,7 @@ function:
|
||||
|
||||
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
|
||||
@@ -175,7 +175,7 @@ function
|
||||
public void _MyLevelWasCompleted()
|
||||
{
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user