xiandie/addons/property-inspector/inspector.gd

22 lines
728 B
GDScript

extends EditorInspectorPlugin
var move_editor = preload("pro_animation_sprite2d/pro_animation_move_editor.gd")
var action_editor = preload("pro_animation_sprite2d/pro_animation_action_editor.gd")
func _can_handle(object):
return object is ProAnimatedSprite2D
func _parse_property(object, type, name, hint_type, hint_string, usage_flags, wide):
# var properties: PackedStringArray = ["action_configs", "move_configs"]
# add_property_editor_for_multiple_properties("配置", properties, action_editor.instantiate())
if name == "move_configs":
add_property_editor(name, move_editor.new())
return true
elif name == "action_configs":
add_property_editor(name, action_editor.new())
return true
else:
return false