Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Jan 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions tutorials/scripting/c_sharp/c_sharp_exports.rst
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,17 @@ Exported members can specify a default value; otherwise, the `default value of t
set => _greeting = value;
}
Resources and nodes can be exported.
Any type of ``Resource`` or ``Node`` 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``. See :ref:`Nodes and Resources <doc_c_sharp_exports_nodes>`.

.. code-block:: csharp
[Export]
public Resource Resource { get; set; }
public PackedScene PackedScene { get; set; }
[Export]
public Node Node { get; set; }
public RigidBody2D RigidBody2D { get; set; }
Grouping exports
----------------
Expand Down Expand Up @@ -241,6 +243,8 @@ Color given as red-green-blue value (alpha will always be 1).
[Export(PropertyHint.ColorNoAlpha)]
private Color Color { get; set; }
.. _doc_c_sharp_exports_nodes:

Nodes
-----

Expand Down