@@ -105,20 +105,33 @@ Here is how a ``_process()`` function might look for you:
105
105
// Code to execute both in editor and in game.
106
106
}
107
107
108
+ .. _doc_running_code_in_the_editor_important_information :
109
+
108
110
Important information
109
111
---------------------
110
112
111
- Any other GDScript that your tool script uses must *also * be a tool. Any
112
- GDScript without ``@tool `` used by the editor will act like an empty file!
113
+ The general rule is that **any other GDScript that your tool script uses must
114
+ *also* be a tool **. The editor is not able to construct instances from GDScript
115
+ files without ``@tool ``, which means you cannot call methods or reference member
116
+ variables from them otherwise. However, since static methods, constants and
117
+ enums can be used without creating an instance, it is possible to call them or
118
+ reference them from a ``@tool `` script onto other non-tool scripts. One exception to
119
+ this are :ref: `static variables <doc_gdscript_basics_static_variables >`.
120
+ If you try to read a static variable's value in a script that does not have
121
+ ``@tool ``, it will always return ``null `` but won't print a warning or error
122
+ when doing so. This restriction does not apply to static methods, which can be
123
+ called regardless of whether the target script is in tool mode.
113
124
114
125
Extending a ``@tool `` script does not automatically make the extending script
115
126
a ``@tool ``. Omitting ``@tool `` from the extending script will disable tool
116
- behavior from the super class. Therefore the extending script should also
127
+ behavior from the super class. Therefore, the extending script should also
117
128
specify the ``@tool `` annotation.
118
129
119
- Modifications in the editor are permanent. For example, in the next
120
- section when we remove the script, the node will keep its rotation. Be careful
121
- to avoid making unwanted modifications.
130
+ Modifications in the editor are permanent, with no undo/redo possible. For
131
+ example, in the next section when we remove the script, the node will keep its
132
+ rotation. Be careful to avoid making unwanted modifications. Consider setting up
133
+ :ref: `version control <doc_version_control_systems >` to avoid losing work in
134
+ case you make a mistake.
122
135
123
136
Try ``@tool `` out
124
137
-----------------
0 commit comments