mirror of
https://github.com/godotengine/godot-docs.git
synced 2026-01-05 22:09:56 +03:00
Merge branch 'master' into 3.2
This commit is contained in:
@@ -56,15 +56,15 @@ Windows (JetBrains Rider)
|
||||
JetBrains Rider comes with bundled MSBuild, so nothing extra is required.
|
||||
Make sure to set the following preferences:
|
||||
|
||||
- In Godot:
|
||||
- In Godot's Editor Settings:
|
||||
|
||||
- Mono External Editor to JetBrains Rider
|
||||
- Mono Build Tool to JetBrains Mono.
|
||||
- Set **Mono External Editor** to **JetBrains Rider**.
|
||||
- set **Mono Build Tool** to **JetBrains Mono**.
|
||||
|
||||
- In Rider:
|
||||
|
||||
- Set ``MSBuild version`` to either bundled with Rider or .NET Core.
|
||||
- Install **Godot support** plugin.
|
||||
- Set **MSBuild version** to either **Bundled with Rider** or **.NET Core**.
|
||||
- Install the **Godot support** plugin.
|
||||
|
||||
macOS and Linux
|
||||
~~~~~~~~~~~~~~~
|
||||
@@ -110,19 +110,23 @@ external editors:
|
||||
- Visual Studio for Mac
|
||||
- JetBrains Rider
|
||||
|
||||
.. note:: If you are using Visual Studio Code, ensure you download and install
|
||||
the `C# extension <https://marketplace.visualstudio.com/items?itemName=ms-vscode.csharp>`_
|
||||
to enable features like syntax highlighting and IntelliSense.
|
||||
.. note::
|
||||
|
||||
If you are using Visual Studio Code, ensure you download and install the
|
||||
`C# extension <https://marketplace.visualstudio.com/items?itemName=ms-vscode.csharp>`_
|
||||
to enable features like syntax highlighting and IntelliSense.
|
||||
|
||||
.. note:: If you are using Visual Studio 2019, you must follow the instructions found in the "Configure VS2019 for Debugging" section below.
|
||||
.. note::
|
||||
|
||||
If you are using Visual Studio 2019, you must follow the instructions found
|
||||
in the `:ref:doc_c_sharp_configuring_vs_2019_for_debugging` section below.
|
||||
|
||||
|
||||
Creating a C# script
|
||||
--------------------
|
||||
|
||||
After you successfully set up C# for Godot, you should see the following option
|
||||
when selecting ``Attach script`` in the context menu of a node in your scene:
|
||||
when selecting **Attach Script** in the context menu of a node in your scene:
|
||||
|
||||
.. image:: img/attachcsharpscript.png
|
||||
|
||||
@@ -195,6 +199,16 @@ In general, the C# Godot API strives to be as idiomatic as is reasonably possibl
|
||||
|
||||
For more information, see the :ref:`doc_c_sharp_differences` page.
|
||||
|
||||
.. warning::
|
||||
|
||||
You need to (re)build the project assemblies whenever you want to see new
|
||||
exported variables or signals in the editor. This build can be manually
|
||||
triggered by clicking the word **Mono** at the bottom of the editor window
|
||||
to reveal the Mono panel, then clicking the **Build Project** button.
|
||||
|
||||
You will also need to rebuild the project assemblies to apply changes in
|
||||
"tool" scripts.
|
||||
|
||||
Current gotchas and known issues
|
||||
--------------------------------
|
||||
|
||||
@@ -267,6 +281,8 @@ Profiling your C# code
|
||||
- `Mono log profiler <https://www.mono-project.com/docs/debug+profile/profile/profiler/>`_ is available for Linux and macOS. Due to a Mono change, it does not work on Windows currently.
|
||||
- External Mono profiler like `JetBrains dotTrace <https://www.jetbrains.com/profiler/>`_ can be used as described `here <https://github.com/godotengine/godot/pull/34382>`_.
|
||||
|
||||
.. _doc_c_sharp_configuring_vs_2019_for_debugging:
|
||||
|
||||
Configuring VS 2019 for debugging
|
||||
---------------------------------
|
||||
|
||||
|
||||
@@ -121,7 +121,7 @@ This attribute should be used on a `delegate`, whose name signature will be used
|
||||
[Signal]
|
||||
delegate void MySignal(string willSendsAString);
|
||||
|
||||
See also: :ref:`c_sharp_signals`
|
||||
See also: :ref:`doc_c_sharp_signals`.
|
||||
|
||||
Singletons
|
||||
----------
|
||||
|
||||
@@ -78,7 +78,7 @@ otherwise it returns true.
|
||||
|
||||
For more advanced type checking, you can look into `Pattern Matching <https://docs.microsoft.com/en-us/dotnet/csharp/pattern-matching>`_.
|
||||
|
||||
.. _c_sharp_signals:
|
||||
.. _doc_c_sharp_signals:
|
||||
|
||||
C# signals
|
||||
----------
|
||||
|
||||
@@ -1315,7 +1315,7 @@ If a class inherits from :ref:`class_Reference`, then instances will be
|
||||
freed when no longer in use. No garbage collector exists, just
|
||||
reference counting. By default, all classes that don't define
|
||||
inheritance extend **Reference**. If this is not desired, then a class
|
||||
must inherit :ref:`class_Object` manually and must call instance.free(). To
|
||||
must inherit :ref:`class_Object` manually and must call ``instance.free()``. To
|
||||
avoid reference cycles that can't be freed, a ``weakref`` function is
|
||||
provided for creating weak references.
|
||||
|
||||
|
||||
@@ -179,7 +179,7 @@ from the FileSystem dock at once.
|
||||
|
||||
# Exported arrays can specify type (using the same hints as before).
|
||||
|
||||
export(Array, int) var ints = [1,2,3]
|
||||
export(Array, int) var ints = [1, 2, 3]
|
||||
export(Array, int, "Red", "Green", "Blue") var enums = [2, 1, 0]
|
||||
export(Array, Array, float) var two_dimensional = [[1.0, 2.0], [3.0, 4.0]]
|
||||
|
||||
|
||||
@@ -640,7 +640,7 @@ Start with the ``_init()`` callback method, that the engine will call upon
|
||||
creating the object in memory. Follow with the ``_ready()`` callback, that Godot
|
||||
calls when it adds a node to the scene tree.
|
||||
|
||||
These function should come first because they show how the object is
|
||||
These functions should come first because they show how the object is
|
||||
initialized.
|
||||
|
||||
Other built-in virtual callbacks, like ``_unhandled_input()`` and
|
||||
|
||||
@@ -248,7 +248,7 @@ Typed or dynamic: stick to one style
|
||||
------------------------------------
|
||||
|
||||
Typed GDScript and dynamic GDScript can coexist in the same project. But
|
||||
I recommended to stick to either style for consistency in your codebase,
|
||||
I recommend to stick to either style for consistency in your codebase,
|
||||
and for your peers. It's easier for everyone to work together if you
|
||||
follow the same guidelines, and faster to read and understand other
|
||||
people's code.
|
||||
|
||||
Reference in New Issue
Block a user