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

Update the state of C#/.NET support as of 4.2 #8142

Merged
merged 1 commit into from
Oct 3, 2023
Merged
Show file tree
Hide file tree
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
18 changes: 15 additions & 3 deletions about/list_of_features.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ Platforms
Godot aims to be as platform-independent as possible and can be
:ref:`ported to new platforms <doc_custom_platform_ports>` with relative ease.

.. note::

Projects written in C# using Godot 4 currently cannot be exported to iOS
and web platforms. To use C# on those platforms, consider Godot 3 instead.
Android platform support is available as of Godot 4.2, but is experimental
and :ref:`some limitations apply <doc_c_sharp_platforms>`.

Editor
------

Expand Down Expand Up @@ -429,12 +436,17 @@ Scripting
:ref:`C#: <toc-learn-scripting-C#>`

- Packaged in a separate binary to keep file sizes and dependencies down.
- Uses .NET 6.
- Supports .NET 6 and higher.

- Full support for the C# 10.0 syntax and features.

- Supports Windows, Linux and macOS. Mobile/web platforms are currently
unsupported. To use C# on mobile/web platforms, use Godot 3 instead.
- Supports Windows, Linux, and macOS. As of 4.2 experimental support for Android
is also available (requires a .NET 7.0 project).

- On the Android platform only some architectures are supported: ``arm64`` and ``x64``.
- iOS and web platforms are currently unsupported. To use C# on those platforms,
consider Godot 3 instead.

- Using an external editor is recommended to benefit from IDE functionality.

**GDExtension (C, C++, Rust, D, ...):**
Expand Down
7 changes: 4 additions & 3 deletions getting_started/step_by_step/scripting_languages.rst
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,10 @@ officially supported .NET option.

.. attention::

Projects written in C# using Godot 4.x currently cannot be exported to
Android, iOS and web platforms. To use C# on those platforms, use Godot 3
instead.
Projects written in C# using Godot 4 currently cannot be exported to iOS
YuriSizov marked this conversation as resolved.
Show resolved Hide resolved
and web platforms. To use C# on those platforms, consider Godot 3 instead.
Android platform support is available as of Godot 4.2, but is experimental
and :ref:`some limitations apply <doc_c_sharp_platforms>`.

C++ via GDExtension
~~~~~~~~~~~~~~~~~~~
Expand Down
18 changes: 4 additions & 14 deletions tutorials/scripting/c_sharp/c_sharp_basics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,6 @@ C# basics
Introduction
------------

.. warning::

.NET support has been heavily modified between Godot 3 and 4. As such, you
may still run into some issues, or find spots where the documentation could
be improved.

Please report issues with C# in Godot on the
`engine GitHub page <https://github.com/godotengine/godot/issues>`_,
and any documentation issues on the
`documentation GitHub page <https://github.com/godotengine/godot-docs/issues>`_.

This page provides a brief introduction to C#, both what it is and
how to use it in Godot. Afterwards, you may want to look at
:ref:`how to use specific features <doc_c_sharp_features>`, read about the
Expand All @@ -29,9 +18,10 @@ it is implemented with .NET 6.0.

.. attention::

Projects written in C# using Godot 4.x currently cannot be exported to
Android, iOS and web platforms. To use C# on those platforms, use Godot 3
instead.
Projects written in C# using Godot 4 currently cannot be exported to iOS
and web platforms. To use C# on those platforms, consider Godot 3 instead.
Android platform support is available as of Godot 4.2, but is experimental
and :ref:`some limitations apply <doc_c_sharp_platforms>`.

.. note::

Expand Down
7 changes: 2 additions & 5 deletions tutorials/scripting/c_sharp/c_sharp_exports.rst
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
.. _doc_c_sharp_exports:

C# exports
==========

Introduction to exports
-----------------------
C# exported properties
======================

In Godot, class members can be exported. This means their value gets saved along
with the resource (such as the :ref:`scene <class_PackedScene>`) they're
Expand Down
4 changes: 2 additions & 2 deletions tutorials/scripting/c_sharp/c_sharp_features.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.. _doc_c_sharp_features:

C# features
===========
C# language features
====================

This page provides an overview of the commonly used features of both C# and Godot
and how they are used together.
Expand Down
45 changes: 41 additions & 4 deletions tutorials/scripting/c_sharp/index.rst
Original file line number Diff line number Diff line change
@@ -1,17 +1,54 @@
C#
===
C#/.NET
=======

C# is a high-level programming language developed by Microsoft. Godot supports
C# as an option for a scripting language, alongside Godot's own :ref:`GDScript<toc-learn-scripting-gdscript>`.

The standard Godot executable does not contain C# support out of the box. Instead,
to enable C# support for your project you need to `download a .NET version <https://godotengine.org/download/>`_
of the editor from the Godot website.


.. toctree::
:maxdepth: 1
:name: toc-learn-scripting-C#

c_sharp_basics
c_sharp_features
c_sharp_style_guide
diagnostics/index

Godot API for C#
----------------

As a general purpose game engine Godot offers some high-level features as a part
of its API. Articles below explain how these features intergrate into C# and how
C# API may be different from GDScript.

.. toctree::
:maxdepth: 1
:name: toc-learn-scripting-C#-differences

c_sharp_differences
c_sharp_collections
c_sharp_variant
c_sharp_signals
c_sharp_exports
c_sharp_global_classes
c_sharp_style_guide
diagnostics/index

.. _doc_c_sharp_platforms:

C# platform support
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I love the new index page, but I'm not sure if this is the best place for this section. We have similar sections in c_sharp_basics (Current gotchas and known issues or Common pitfalls) but I'm not sure if that's better, to be honest I think the c_sharp_basics page should probably be split into multiple pages.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know what you mean, and I was thinking removing some stuff from the basics page that can be now found on the index page... but ultimately decided that a bit of duplication is fine. These are likely to be the two landing pages, so it makes sense to have a bit of important information on both of them.

I do support reorganizing the docs, though. I'm not entirely sure why we have articles framed as introduction to C#. That's probably unnecessary and we could go straight into Godot-specific stuff (with some notes here and there that link Godot API to C# concepts).

I could give it a go as time allows, but it would be harder for me to find a good angle here since I'm neither a C# user nor maintainer 🙃 But I can help, if you're interested.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would love that, maybe we can do that after the 4.2 release. For now I think this is good.

-------------------

As of Godot 4.2 projects written in C# support all desktop platforms (Windows, Linux,
and macOS), as well as Android. Android support is currently experimental and has a few
limitations.

- Projects targeting Android need to be created using .NET 7.0 or higher. This requires
modifying the `.csproj` file generated by Godot.

- Only some Android architectures are supported: ``arm64`` and ``x64``.

Currently, projects written in C# cannot be exported to iOS and web platforms. To use C#
on those platforms, consider Godot 3 instead.
7 changes: 2 additions & 5 deletions tutorials/scripting/gdscript/gdscript_exports.rst
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
.. _doc_gdscript_exports:

GDScript exports
================

Introduction to exports
-----------------------
GDScript exported properties
============================

In Godot, class members can be exported. This means their value gets saved along
with the resource (such as the :ref:`scene <class_PackedScene>`) they're
Expand Down