Skip to content

Commit

Permalink
Update the state of C#/.NET support as of 4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
YuriSizov committed Oct 3, 2023
1 parent 228c10e commit f25a29e
Show file tree
Hide file tree
Showing 7 changed files with 70 additions and 36 deletions.
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
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
-------------------

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 targetting 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

0 comments on commit f25a29e

Please sign in to comment.