Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warn about non-tool plugin scripts in C# #6138

Merged
merged 3 commits into from
Oct 15, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions tutorials/plugins/editor/inspector_plugins.rst
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ specifically add :ref:`class_EditorProperty`-based controls.
#if TOOLS
using Godot;

[Tool]
public class MyInspectorPlugin : EditorInspectorPlugin
{
public override bool CanHandle(Object @object)
Expand Down Expand Up @@ -247,6 +248,7 @@ followed by ``set_bottom_editor()`` to position it below the name.
#if TOOLS
using Godot;

[Tool]
public class RandomIntEditor : EditorProperty
{
// The main control for editing the property.
Expand Down
9 changes: 6 additions & 3 deletions tutorials/plugins/editor/making_plugins.rst
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,12 @@ editor, and it must inherit from :ref:`class_EditorPlugin`.

.. warning::

In addition to the EditorPlugin script, any other GDScript that your plugin uses
must *also* be a tool. Any GDScript without ``tool`` imported into the editor
will act like an empty file!
In addition to the EditorPlugin script, any other script that your plugin uses
must *also* be a tool.
- Any GDScript without ``tool`` imported into the editor will act like
an empty file!
- Any C# class without ``[Tool]`` won't be reloaded when the project is
built forcing you to re-enable the plugin!
mhilbrunner marked this conversation as resolved.
Show resolved Hide resolved

It's important to deal with initialization and clean-up of resources.
A good practice is to use the virtual function
Expand Down