Event Trigger Update

This commit is contained in:
2025-06-09 09:24:32 -05:00
parent 8f52da0f5d
commit 3c11b232fa
17 changed files with 131 additions and 133 deletions

View File

@@ -1,8 +1,18 @@
class_name EventIf extends "res://scripts/Event/Flow/EventGroup.gd"
signal eventConditionMet
func ifCondition() -> bool:
return false
func subscribeEvents() -> void:
# Override this method to subscribe to any events needed for the condition check
pass
func unsubscribeEvents() -> void:
# Override this method to unsubscribe from any events when the condition is no longer needed
pass
func shouldAutoStart() -> bool:
return false
@@ -10,4 +20,15 @@ func start() -> void:
super.start()
if ifCondition():
startEventGroup()
startEventGroup()
func onEventTrigger() -> void:
if !ifCondition():
return
eventConditionMet.emit()
func onTriggerListening(_trigger:EventTrigger) -> void:
subscribeEvents()
func onTriggerNotListening(_trigger:EventTrigger) -> void:
unsubscribeEvents()