mirror of
https://github.com/godotengine/godot-docs.git
synced 2026-01-04 14:11:02 +03:00
update c# class examples
This commit is contained in:
@@ -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
|
||||
{
|
||||
|
||||
@@ -100,7 +100,7 @@ Example:
|
||||
|
||||
using Godot;
|
||||
|
||||
public class MyNode : Node
|
||||
public partial class MyNode : Node
|
||||
{
|
||||
[Export]
|
||||
private NodePath _nodePath;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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; }
|
||||
|
||||
Reference in New Issue
Block a user