mirror of
https://github.com/lightsoutgames/godot-tts
synced 2024-11-22 19:55: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
|
var tts = null
|
||||||
|
|
||||||
func _ready():
|
func _ready():
|
||||||
|
if not TTS:
|
||||||
|
return
|
||||||
if not OS.has_feature('JavaScript') and not Engine.has_singleton("AndroidTTS"):
|
if not OS.has_feature('JavaScript') and not Engine.has_singleton("AndroidTTS"):
|
||||||
TTS = preload("godot-tts.gdns")
|
TTS = preload("godot-tts.gdns")
|
||||||
if OS.has_feature('JavaScript'):
|
if OS.has_feature('JavaScript'):
|
||||||
|
@ -77,4 +79,6 @@ func singular_or_plural(count, singular, plural):
|
||||||
return plural
|
return plural
|
||||||
|
|
||||||
func _exit_tree():
|
func _exit_tree():
|
||||||
|
if not tts or not TTS:
|
||||||
|
return
|
||||||
tts.free()
|
tts.free()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user