GD0110: The exported tool button is not a Callable

規則 ID

GD0110

分類

用法

修正是否會破壞相容性

Breaking - If the property's type is changed to Callable

Non-breaking - If the [ExportToolButton] is replaced with [Export]

預設啟用

原因

A property of a type different from Callable is annotated with the [ExportToolButton] attribute.

規則說明

The [ExportToolButton] attribute is used to create clickable buttons in the inspector so, the property must be a Callable that will be executed when clicking the button.

修正方式

To fix a violation of this rule, change the type of the property to Callable. Alternatively, if you intended to export a normal property, replace the [ExportToolButton] attribute with [Export].

什麼時候應該忽略警告

Do not suppress a warning from this rule. The exported property must be a Callable so it can executed in the editor when clicking the button in the inspector.