xiandie/addons/property-inspector/inspector.gd

25 lines
978 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")
var stages_editor = preload("event_2d/stages_editor.gd")
func _can_handle(object):
return object is ProAnimatedSprite2D or object is Event2D or object is EventBinder
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
elif name == "pre_event_stages" or name == "event_stages" or name == "updater_stages":
add_property_editor(name, stages_editor.new(name))
return true
return false