mirror of
https://github.com/lightsoutgames/godot-tts
synced 2024-12-22 14:45:57 +00:00
Don't initialize/free if we can't.
This commit is contained in:
parent
3b067faecd
commit
c4646c4b26
4
TTS.gd
4
TTS.gd
|
@ -6,6 +6,8 @@ var TTS
|
|||
var tts = null
|
||||
|
||||
func _ready():
|
||||
if not TTS:
|
||||
return
|
||||
if not OS.has_feature('JavaScript') and not Engine.has_singleton("AndroidTTS"):
|
||||
TTS = preload("godot-tts.gdns")
|
||||
if OS.has_feature('JavaScript'):
|
||||
|
@ -77,4 +79,6 @@ func singular_or_plural(count, singular, plural):
|
|||
return plural
|
||||
|
||||
func _exit_tree():
|
||||
if not tts or not TTS:
|
||||
return
|
||||
tts.free()
|
||||
|
|
Loading…
Reference in New Issue
Block a user