35 lines
545 B
GDScript
35 lines
545 B
GDScript
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 |