I noticed that the tutorial still says `instance()` instead of `instantiate()`, so I changed it to match the 4.x method name.
(cherry picked from commit ef828fb837)
EditorScript is useful for one-off operations such as:
- Use as a playground for GDScript or C# scripting without
having to run a project.
- Scale all light nodes in the currently edited scene.
- Replace nodes that were copy-pasted with scene instances.
Godot 4.0 added a new parameter to EditorInspectorPlugin._parse_property. This was updated in the C# version of the tutorial, but not the gdscript version
Co-authored-by: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com>
- Rename members that have been renamed in Godot's C# API for 4.0.
- Change `delta` parameter type to `double`.
- Ensure parameters match base declaration.
- Follow our code style more closely.
- Other minor code fixes.
The sample code listed the function ``get_import_options`` when it most likely meant ``_get_import_options`` (with an underscore in front). Some of the sample code also used the outdated File API instead of the FileAccess API.
Corrected more function names. Updated parameters for _get_import_options and _get_preset_name in sample code.
- Replaced the "empty string" with "empty array" in the comment about how to report no errors.
- Renamed warning variable to warnings to indicate that it can contain multiple warnings.
* Fixed C# EditorInspectorPlugin _CanHandle parameter type
Updated Inspector Plugin tutorial to reflect that C#'s
EditorInspectorPlugin::_CanHandle() takes a GodotObject, not a
Variant.
* Eliminated horizontal scroll in C# for inspector-plugin tutorial
Put a line-break and indentation to avoid horizontal scrolling in
the displayed code.
* Fixed _ParseProperty() method signature and undeclared variable
Changed example code for EditorInspectorPlugin::_ParseProperty():
* Fixed method signature
* Use new enum type of parameter for comparison instead of int.
* Use "name" parameter as property-identifying argument to
AddPropertyEditor() instead of undeclared variable
* Fixed override method name in EditorProperty example
Updated example to use virtual method _UpdateProperty() instead of
non-virtual method UpdateProperty().
* Replace legacy setget in tool tutorial
Replace reference to legacy setget keyword and replace it with the new setter style in the "Running Code in the Editor" tutorial.
---------
Co-authored-by: Yuri Sizov <11782833+YuriSizov@users.noreply.github.com>
The example (tutorial) plugin resides in an addons/my_custom_node
subdirectory of its project. The C# example code uses the same
relative path structure for a custom script and icon as the
GDScript example. These paths cause errors when the user activates
the plugin, as Godot looks for the resources in the root directory
of the project. This change fixes the errors by using the fully
qualified "res://" path to the resources in the C# example code.
Current code doesn't work with Godot 4.0
I added @ to export variables and changed update_configuration_warning() to new update_configuration_warnings().
* Update some C# examples
- Rename members that have been renamed in Godot's C# API for 4.0.
- Change `delta` parameter type to `double`.
- Ensure parameters match base declaration.
- Other minor code fixes.
---------
Co-authored-by: Paul Joannon <437025+paulloz@users.noreply.github.com>
As mentioned here https://github.com/godotengine/godot-docs/issues/6716
add/remove_node3d_gizmo_plugin is the wrong method name. But i'm not sure if it intentionally changed to add/remove_node_3d_gizmo_plugin.
Here are the adjustments anway in case it is intentional and going to stay that way.