Up to date

This page is up to date for Godot 4.2. If you still find outdated information, please open an issue.

C#/.NET

C# - это язык программирования, разработанный Microsoft. Godot поддерживает C# в качестве варианта для языка скриптов, наряду с собственным языком Godot GDScript.

Стандартный исполняемый файл Godot не содержит поддержку C#. Вместо этого, чтобы включить поддержку C# для вашего проекта, необхоимо скачать .NET версию редактора из вебсайта Godot.

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 integrate into C# and how C# API may be different from GDScript.

C# platform support

As of Godot 4.2 projects written in C# support all desktop platforms (Windows, Linux, and macOS), as well as Android and iOS.

Поддержка Android экспериментальная и содержит некоторый ограничения.

  • Projects targeting Android need to target .NET 7.0 or higher. This requires modifying the .csproj file generated by Godot for existing projects. The following property is added to new projects created with 4.2 and can be added to existing projects:

    <TargetFramework Condition=" '$(GodotTargetPlatform)' == 'android' ">net7.0</TargetFramework>
    
  • Only some Android architectures are supported: arm64 and x64.

iOS support is currently experimental and has a few limitations.

  • Projects targeting iOS need to target .NET 8.0 or higher. This requires modifying the .csproj file generated by Godot for existing projects. The following property is added to new projects created with 4.2 and can be added to existing projects:

    <TargetFramework Condition=" '$(GodotTargetPlatform)' == 'ios' ">net8.0</TargetFramework>
    
  • The official export templates for the iOS simulator only supports the x64 architecture.

  • Exporting to iOS can only be done from a MacOS device.

Пока что проекты, написанные на C#, не могут быть экспортированны на веб платформу. Чтобы использовать C# на этой платформе, используйте Godot 3.