From 251ee359d46fe42ac76de6b01cbaa5da673a08da Mon Sep 17 00:00:00 2001 From: Nolan Darilek Date: Tue, 24 Sep 2019 14:22:15 -0500 Subject: [PATCH] Make `TTS` a singleton and load directly from the plugin. --- project.godot | 2 +- scenes/Main.gd | 2 +- scripts/Globals.gd | 8 -------- 3 files changed, 2 insertions(+), 10 deletions(-) delete mode 100644 scripts/Globals.gd diff --git a/project.godot b/project.godot index 3542c94..38dfdcd 100644 --- a/project.godot +++ b/project.godot @@ -19,7 +19,7 @@ run/main_scene="res://scenes/Main.tscn" [autoload] -Globals="*res://scripts/Globals.gd" +TTS="*res://addons/godot-tts/TTS.gd" [editor_plugins] diff --git a/scenes/Main.gd b/scenes/Main.gd index 463fd62..330a0bb 100644 --- a/scenes/Main.gd +++ b/scenes/Main.gd @@ -6,7 +6,7 @@ extends Node # Called when the node enters the scene tree for the first time. func _ready(): - Globals.tts.speak("Hello, world.", true) + TTS.speak("Hello, world.") # Called every frame. 'delta' is the elapsed time since the previous frame. #func _process(delta): diff --git a/scripts/Globals.gd b/scripts/Globals.gd deleted file mode 100644 index ac7466b..0000000 --- a/scripts/Globals.gd +++ /dev/null @@ -1,8 +0,0 @@ -extends Node - -const TTS = preload("res://addons/godot-tts/TTS.gd") -var tts - -# Called when the node enters the scene tree for the first time. -func _ready(): - tts = TTS.new()