classes/class_editorscript #269
Replies: 2 comments 4 replies
-
|
If you're using c# and an external editor, when you try to open the script in the Script window it will open the other editor instead, so you won't be able to run your script. You could change your editor settings, but that's annoying. A silly but simple fix is to create a sibling GDScript file that loads, instantiates, and runs your C# EditorScript's _Run method. So if I have VerbGenerator.cs and verb_generator.gd in the same folder, this is the code for verb_generator.gd: @tool
extends EditorScript
func _run():
var script_node = load("res://tool_scripts/VerbGenerator.cs").new()
script_node._Run()Now this script you can run from the Script menu, and all it does is load and run your actual C# script. |
Beta Was this translation helpful? Give feedback.
-
|
I also ran into an issue when I was trying to load a custom resource type with my EditorScript with
I solved this by adding |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
classes/class_editorscript
Inherits: RefCounted< Object Base script that can be used to add extension functions to the editor. Description: Scripts extending this class and implementing its_run method can be executed from th...
https://docs.godotengine.org/en/stable/classes/class_editorscript.html
Beta Was this translation helpful? Give feedback.
All reactions