|
@@ -102,10 +102,6 @@ Preprocessor defines
|
|
Godot has a set of defines that allow you to change your C# code
|
|
Godot has a set of defines that allow you to change your C# code
|
|
depending on the environment you are compiling to.
|
|
depending on the environment you are compiling to.
|
|
|
|
|
|
-.. note:: If you created your project before Godot 3.2, you have to modify
|
|
|
|
- or regenerate your `csproj` file to use this feature
|
|
|
|
- (compare ``<DefineConstants>`` with a new 3.2+ project).
|
|
|
|
-
|
|
|
|
Examples
|
|
Examples
|
|
~~~~~~~~
|
|
~~~~~~~~
|
|
|
|
|
|
@@ -115,10 +111,7 @@ For example, you can change code based on the platform:
|
|
|
|
|
|
public override void _Ready()
|
|
public override void _Ready()
|
|
{
|
|
{
|
|
- #if GODOT_SERVER
|
|
|
|
- // Don't try to load meshes or anything, this is a server!
|
|
|
|
- LaunchServer();
|
|
|
|
- #elif GODOT_32 || GODOT_MOBILE || GODOT_WEB
|
|
|
|
|
|
+ #if (GODOT_32 || GODOT_MOBILE || GODOT_WEB)
|
|
// Use simple objects when running on less powerful systems.
|
|
// Use simple objects when running on less powerful systems.
|
|
SpawnSimpleObjects();
|
|
SpawnSimpleObjects();
|
|
#else
|
|
#else
|
|
@@ -167,7 +160,7 @@ Full list of defines
|
|
* One of ``GODOT_64`` or ``GODOT_32`` is defined depending on if the architecture is 64-bit or 32-bit.
|
|
* One of ``GODOT_64`` or ``GODOT_32`` is defined depending on if the architecture is 64-bit or 32-bit.
|
|
|
|
|
|
* One of ``GODOT_LINUXBSD``, ``GODOT_WINDOWS``, ``GODOT_OSX``,
|
|
* One of ``GODOT_LINUXBSD``, ``GODOT_WINDOWS``, ``GODOT_OSX``,
|
|
- ``GODOT_ANDROID``, ``GODOT_IOS``, ``GODOT_HTML5``, or ``GODOT_SERVER``
|
|
|
|
|
|
+ ``GODOT_ANDROID``, ``GODOT_IOS``, ``GODOT_WEB``
|
|
depending on the OS. These names may change in the future.
|
|
depending on the OS. These names may change in the future.
|
|
These are created from the ``get_name()`` method of the
|
|
These are created from the ``get_name()`` method of the
|
|
:ref:`OS <class_OS>` singleton, but not every possible OS
|
|
:ref:`OS <class_OS>` singleton, but not every possible OS
|