mirror of
https://github.com/godotengine/godot-docs.git
synced 2026-01-04 14:11:02 +03:00
Fixed GetNode inconsistencies (#5056)
* Fixed GetNode inconsistencies (C#) The generic method should be used instead. See #4794.
This commit is contained in:
@@ -83,7 +83,7 @@ There are two ways to load resources from code. First, you can use the ``load()`
|
||||
public override void _Ready()
|
||||
{
|
||||
var texture = (Texture)GD.Load("res://robi.png"); // Godot loads the Resource when it reads the line.
|
||||
var sprite = (Sprite)GetNode("sprite");
|
||||
var sprite = GetNode<Sprite>("sprite");
|
||||
sprite.Texture = texture;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user