Event Go To
This commit is contained in:
35
scripts/Event/Flow/EventGoTo.gd
Normal file
35
scripts/Event/Flow/EventGoTo.gd
Normal 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
|
1
scripts/Event/Flow/EventGoTo.gd.uid
Normal file
1
scripts/Event/Flow/EventGoTo.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://da7fr2bave0c
|
@@ -76,3 +76,6 @@ func startChild(child:Event) -> void:
|
||||
child.interactee = self.interactee
|
||||
child.interactor = self.interactor
|
||||
child.start()
|
||||
|
||||
if child.isEndingEvent():
|
||||
self.end()
|
Reference in New Issue
Block a user