update c# class examples

This commit is contained in:
Hana
2023-01-11 21:03:35 +01:00
parent 33c61914b4
commit 9e90766a92
37 changed files with 144 additions and 121 deletions

View File

@@ -204,9 +204,8 @@ Here's a blank C# script with some comments to demonstrate how it works.
.. code-block:: csharp
using Godot;
using System;
public class YourCustomClass : Node
public partial class YourCustomClass : Node
{
// Member variables here, example:
private int a = 2;
@@ -302,7 +301,6 @@ a single code location:
.. code-block:: csharp
using Godot;
using System;
public class YourCustomClass : Node3D
{

View File

@@ -100,7 +100,7 @@ Example:
using Godot;
public class MyNode : Node
public partial class MyNode : Node
{
[Export]
private NodePath _nodePath;

View File

@@ -13,7 +13,9 @@ Exporting is done by using the ``[Export]`` attribute.
.. code-block:: csharp
public class ExportExample : Node3D
using Godot;
public partial class ExportExample : Node3D
{
[Export]
private int Number = 5;

View File

@@ -153,7 +153,9 @@ Consequently, any ``Node`` or ``Reference`` will be compatible automatically, bu
.. code-block:: csharp
public class DataObject : Godot.Object
using Godot;
public partial class DataObject : Godot.Object
{
public string Field1 { get; set; }
public string Field2 { get; set; }