index.rst 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. C#/.NET
  2. =======
  3. C# is a high-level programming language developed by Microsoft. Godot supports
  4. C# as an option for a scripting language, alongside Godot's own :ref:`GDScript<toc-learn-scripting-gdscript>`.
  5. The standard Godot executable does not contain C# support out of the box. Instead,
  6. to enable C# support for your project you need to `download a .NET version <https://godotengine.org/download/>`_
  7. of the editor from the Godot website.
  8. .. toctree::
  9. :maxdepth: 1
  10. :name: toc-learn-scripting-C#
  11. c_sharp_basics
  12. c_sharp_features
  13. c_sharp_style_guide
  14. diagnostics/index
  15. Godot API for C#
  16. ----------------
  17. As a general purpose game engine Godot offers some high-level features as a part
  18. of its API. Articles below explain how these features integrate into C# and how
  19. C# API may be different from GDScript.
  20. .. toctree::
  21. :maxdepth: 1
  22. :name: toc-learn-scripting-C#-differences
  23. c_sharp_differences
  24. c_sharp_collections
  25. c_sharp_variant
  26. c_sharp_signals
  27. c_sharp_exports
  28. c_sharp_global_classes
  29. .. _doc_c_sharp_platforms:
  30. C# platform support
  31. -------------------
  32. As of Godot 4.2 projects written in C# support all desktop platforms (Windows, Linux,
  33. and macOS), as well as Android and iOS.
  34. Android support is currently experimental and has a few limitations.
  35. - Projects targeting Android need to target .NET 7.0 or higher. This requires
  36. modifying the `.csproj` file generated by Godot for existing projects.
  37. The following property is added to new projects created with 4.2 and can be
  38. added to existing projects:
  39. .. code-block:: xml
  40. <TargetFramework Condition=" '$(GodotTargetPlatform)' == 'android' ">net7.0</TargetFramework>
  41. - Only some Android architectures are supported: ``arm64`` and ``x64``.
  42. iOS support is currently experimental and has a few limitations.
  43. - Projects targeting iOS need to target .NET 8.0 or higher. This requires
  44. modifying the `.csproj` file generated by Godot for existing projects.
  45. The following property is added to new projects created with 4.2 and can be
  46. added to existing projects:
  47. .. code-block:: xml
  48. <TargetFramework Condition=" '$(GodotTargetPlatform)' == 'ios' ">net8.0</TargetFramework>
  49. - The official export templates for the iOS simulator only supports the ``x64`` architecture.
  50. - Exporting to iOS can only be done from a MacOS device.
  51. Currently, projects written in C# cannot be exported to the web platform. To use C#
  52. on that platform, consider Godot 3 instead.