small changes
This commit is contained in:
+22
-3
@@ -1,5 +1,6 @@
|
||||
extends Control
|
||||
|
||||
var balloon: Node
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
@@ -7,6 +8,24 @@ func _ready() -> void:
|
||||
|
||||
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta: float) -> void:
|
||||
pass
|
||||
func start_balloon(dialogue_resource: Resource, start_title: String):
|
||||
|
||||
#Freeing Previous Balloon and Disconnecting DialogueManager signals
|
||||
clean_balloon()
|
||||
|
||||
#Instantiating a custom balloon
|
||||
var balloon_path = "res://Dialogues/balloon_big.tscn"
|
||||
var Balloon: Resource = load(balloon_path)
|
||||
balloon = Balloon.instantiate()
|
||||
get_tree().current_scene.add_child(balloon)
|
||||
|
||||
#Starting dialogue
|
||||
balloon.start(dialogue_resource, start_title)
|
||||
|
||||
|
||||
|
||||
func clean_balloon():
|
||||
|
||||
#Freeing Previous Balloon
|
||||
if is_instance_valid(balloon):
|
||||
balloon.queue_free()
|
||||
|
||||
Reference in New Issue
Block a user