Skip to content

Commit

Permalink
修正demo遗漏的API变换
Browse files Browse the repository at this point in the history
  • Loading branch information
Daylily-Zeleen committed Jul 20, 2024
1 parent b491b80 commit fef5582
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions demo/dragonbones_demo/demo.gd
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ extends Node
# Setup UI to control DragonBonesArmature's properties.
func _ready() -> void:
# AnimationCallbackModeProcess
for e: String in ClassDB.class_get_enum_constants(&"DragonBonesArmature", &"AnimationCallbackModeProcess"):
for e: String in ClassDB.class_get_enum_constants(&"DragonBones", &"AnimationCallbackModeProcess"):
animation_process_mode_option_btn.add_item(e.rsplit("_", false, 1)[1])
animation_process_mode_option_btn.set_item_metadata(animation_process_mode_option_btn.item_count - 1, DragonBonesArmature[e])
animation_process_mode_option_btn.set_item_metadata(animation_process_mode_option_btn.item_count - 1, DragonBones[e])

animation_process_mode_option_btn.item_selected.connect(_on_process_mode_option_btn_item_selected)
for idx in range(animation_process_mode_option_btn.item_count):
Expand Down Expand Up @@ -56,8 +56,8 @@ func _ready() -> void:
%AdvanceBtn.pressed.connect(_on_advance_btn_pressed)

func _on_process_mode_option_btn_item_selected(index: int) -> void:
dragonbones.callback_mode_process = animation_process_mode_option_btn.get_item_metadata(index)
%AdvanceUI.visible = dragonbones.callback_mode_process == DragonBones.ANIMATION_CALLBACK_MODE_PROCESS_MANUAL
dragonbones.animation_callback_mode_process = animation_process_mode_option_btn.get_item_metadata(index)
%AdvanceUI.visible = dragonbones.animation_callback_mode_process == DragonBones.ANIMATION_CALLBACK_MODE_PROCESS_MANUAL


func _on_animation_option_btn_item_selected(index: int) -> void:
Expand All @@ -72,7 +72,7 @@ func _on_animation_option_btn_item_selected(index: int) -> void:


func _on_advance_btn_pressed() -> void:
assert(dragonbones.callback_mode_process == DragonBones.ANIMATION_CALLBACK_MODE_PROCESS_MANUAL)
assert(dragonbones.animation_callback_mode_process == DragonBones.ANIMATION_CALLBACK_MODE_PROCESS_MANUAL)
var delta :float = %AdvanceTime.value
dragonbones.advance(delta)

0 comments on commit fef5582

Please sign in to comment.