修复攀爬打断钩锁的逻辑bug

This commit is contained in:
RedisTKey 2026-01-10 16:53:21 +08:00
parent a1bdf5264a
commit 4fba14f530
3 changed files with 7 additions and 2 deletions

View File

@ -36,9 +36,10 @@ func _init_trans() -> void:
self.add_transition(dash_state,airbone_state,&"exit_on_air") self.add_transition(dash_state,airbone_state,&"exit_on_air")
##用於處理貼在墻面的State流轉 ##用於處理貼在墻面的State流轉
self.add_transition(ANYSTATE,on_wall_state,&"want_to_on_wall") self.add_transition(ANYSTATE,on_wall_state,&"want_to_on_wall",_can_on_wall)
self.add_transition(on_wall_state,airbone_state,&"exit_on_ground") self.add_transition(on_wall_state,airbone_state,&"exit_on_ground")
self.add_transition(on_wall_state,ground_state,&"exit_on_air") self.add_transition(on_wall_state,ground_state,&"exit_on_air")
#self.add_transition(on_wall_state,grap_hook_state,)
##用於處理鈎爪的State流轉 ##用於處理鈎爪的State流轉
self.add_transition(ANYSTATE,grap_hook_state,&"want_to_grap_hook",_has_move_input) self.add_transition(ANYSTATE,grap_hook_state,&"want_to_grap_hook",_has_move_input)
@ -94,3 +95,6 @@ func _get_dash_exit_enter_state()->LimboState:
func _has_move_input() -> bool: func _has_move_input() -> bool:
return agent.get_move_input() != Vector2.ZERO return agent.get_move_input() != Vector2.ZERO
func _can_on_wall() -> bool:
return not grap_hook_state.is_active()

View File

@ -15,6 +15,7 @@ func _exit() -> void:
agent.locomotion_comp.suspend_climb() agent.locomotion_comp.suspend_climb()
get_root().blackboard.set_var(&"lock_direction_changed",false) get_root().blackboard.set_var(&"lock_direction_changed",false)
print("离开攀爬")
func _update(delta: float) -> void: func _update(delta: float) -> void:
var climb_dir = Input.get_axis("move_up","move_down") as float var climb_dir = Input.get_axis("move_up","move_down") as float

File diff suppressed because one or more lines are too long