mirror of
https://github.com/godotengine/godot-docs.git
synced 2026-01-05 22:09:56 +03:00
Merge pull request #10888 from Calinou/running-code-in-the-editor-static-context
Clarify rules around which scripts require `@tool` in Running code in the editor
This commit is contained in:
@@ -1146,6 +1146,8 @@ Member variables are initialized in the following order:
|
||||
To fix this, move the ``_data`` variable definition above the ``a`` definition
|
||||
or remove the empty dictionary assignment (``= {}``).
|
||||
|
||||
.. _doc_gdscript_basics_static_variables:
|
||||
|
||||
Static variables
|
||||
~~~~~~~~~~~~~~~~
|
||||
|
||||
@@ -1234,6 +1236,13 @@ A base class static variable can also be accessed via a child class:
|
||||
B.x = 3
|
||||
prints(A.x, B.x) # 3 3
|
||||
|
||||
.. note::
|
||||
|
||||
When referencing a static variable from a tool script, the other script
|
||||
containing the static variable **must** also be a tool script.
|
||||
See :ref:`Running code in the editor <doc_running_code_in_the_editor_important_information>`
|
||||
for details.
|
||||
|
||||
``@static_unload`` annotation
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
|
||||
Reference in New Issue
Block a user