mirror of
https://github.com/godotengine/godot-docs.git
synced 2026-01-04 14:11:02 +03:00
Clarify rules around which scripts require @tool in Running code in the editor
- Mention that static methods work, but not static variables. - Emphasize the use of version control due to the lack of undo/redo.
This commit is contained in:
@@ -1099,6 +1099,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
|
||||
~~~~~~~~~~~~~~~~
|
||||
|
||||
@@ -1181,6 +1183,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