index.rst 2.4 KB

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