Move TTS initiaization to _init so script works either as a singleton or an instantiated object.

This commit is contained in:
Nolan Darilek 2020-07-23 14:05:36 -05:00
parent b78848f583
commit dec1d2cc17

8
TTS.gd
View File

@ -7,9 +7,7 @@ var tts
signal done signal done
func _init():
func _ready():
pause_mode = Node.PAUSE_MODE_PROCESS
if OS.get_name() == "Server" or OS.has_feature("JavaScript"): if OS.get_name() == "Server" or OS.has_feature("JavaScript"):
return return
elif Engine.has_singleton("AndroidTTS"): elif Engine.has_singleton("AndroidTTS"):
@ -22,6 +20,10 @@ func _ready():
print_debug("TTS not available!") print_debug("TTS not available!")
func _ready():
pause_mode = Node.PAUSE_MODE_PROCESS
func _get_min_rate(): func _get_min_rate():
if OS.has_feature('JavaScript'): if OS.has_feature('JavaScript'):
return 0.1 return 0.1