Improve C# GD.Load() examples

* Use typed version of GD.Load()
* Use absolute paths (i.e., prefixed with "res://")
* Use "Path/To/" intermediate path values on abstract examples, to
  illustrate that files can live in various directories
* Use PascalCase on files that are not GDScript or GLSL
This commit is contained in:
Mark Wilson
2023-10-06 13:29:26 -04:00
parent fd94ebfaab
commit 147d2233c7
8 changed files with 38 additions and 29 deletions

View File

@@ -337,7 +337,7 @@ uses the mouse pointer. Here is the code for the Player, using ``move_and_slide(
public partial class MyCharacterBody2D : CharacterBody2D
{
private PackedScene _bullet = (PackedScene)GD.Load("res://bullet.tscn");
private PackedScene _bullet = GD.Load<PackedScene>("res://Bullet.tscn");
private int _speed = 200;
public void GetInput()