c_sharp_exports.rst: clarify why exporting nodes/resources is useful

This commit is contained in:
31
2024-01-28 22:45:53 -08:00
parent 67b17958ca
commit 65085d9330

View File

@@ -71,7 +71,9 @@ Exported members can specify a default value; otherwise, the `default value of t
set => _greeting = value;
}
Resources and nodes can be exported.
Resources and nodes can be exported. The property editor shows a user-friendly
assignment dialog for these types. This can be used instead of ``GD.Load`` and
``GetNode``.
.. code-block:: csharp
@@ -81,6 +83,17 @@ Resources and nodes can be exported.
[Export]
public Node Node { get; set; }
Exporting a specific type of resource or node lets the property editor show a
filtered list of possibilities.
.. code-block:: csharp
[Export]
public PackedScene PackedScene { get; set; }
[Export]
public RigidBody2D RigidBody2D { get; set; }
Grouping exports
----------------