allow Agent.speak() to override a previous call to speak()
This commit is contained in:
parent
396ef67c78
commit
d089018082
1 changed files with 6 additions and 4 deletions
|
@ -265,12 +265,14 @@ export class Agent {
|
||||||
}
|
}
|
||||||
|
|
||||||
speak(text: string) {
|
speak(text: string) {
|
||||||
if (this.wordballoonState == null) {
|
if (this.wordballoonState != null) {
|
||||||
|
this.stopSpeaking();
|
||||||
|
}
|
||||||
|
|
||||||
this.wordballoonState = new AgentWordBalloonState(this, text);
|
this.wordballoonState = new AgentWordBalloonState(this, text);
|
||||||
this.wordballoonState.positionUpdated();
|
this.wordballoonState.positionUpdated();
|
||||||
this.wordballoonState.show();
|
this.wordballoonState.show();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
stopSpeaking() {
|
stopSpeaking() {
|
||||||
if (this.wordballoonState !== null) {
|
if (this.wordballoonState !== null) {
|
||||||
|
|
Loading…
Reference in a new issue