Event Go To

This commit is contained in:
2025-05-20 07:28:02 -05:00
parent 7cd96e20d2
commit 6b2fa2b381
7 changed files with 69 additions and 12 deletions

View File

@@ -0,0 +1,35 @@
class_name EventGoTo extends "res://scripts/Event/Event.gd"
enum Type {
GO_TO,
GO_TO_AND_WAIT,
GO_TO_AND_CONTINUE
}
@export var event:Event = null
@export var type:Type = Type.GO_TO
func start() -> void:
super.start()
if event == null:
print("EventGoTo: No event set")
return
event.start()
func isDone():
if !super.isDone():
return false
if event == null:
return true
if type == Type.GO_TO_AND_WAIT:
return event.isDone()
return true
func isEndingEvent() -> bool:
if type == Type.GO_TO:
return true
return false

View File

@@ -0,0 +1 @@
uid://da7fr2bave0c

View File

@@ -76,3 +76,6 @@ func startChild(child:Event) -> void:
child.interactee = self.interactee
child.interactor = self.interactor
child.start()
if child.isEndingEvent():
self.end()