工具模式 (tool)

4.6 2026-01-27

默认情况下,GDScript不会在编辑器(editor)中运行,如果我们在开发插件(plugin),需要在编辑器中执行GDScript,需要使用@tool注解。


@tool
extends Button

func _ready():
    print("Hello")