diff --git a/packages/webgal/src/Core/gameScripts/say.ts b/packages/webgal/src/Core/gameScripts/say.ts index 90a2eb7da..95fb97cfa 100644 --- a/packages/webgal/src/Core/gameScripts/say.ts +++ b/packages/webgal/src/Core/gameScripts/say.ts @@ -23,6 +23,9 @@ export const say = (sentence: ISentence): IPerform => { const dispatch = webgalStore.dispatch; let dialogKey = Math.random().toString(); // 生成一个随机的key let dialogToShow = sentence.content; // 获取对话内容 + if (dialogToShow) { + dialogToShow = String(dialogToShow).replace(/ /g, '\u00a0'); // 替换空格 + } const isConcat = getSentenceArgByKey(sentence, 'concat'); // 是否是继承语句 const isNotend = getSentenceArgByKey(sentence, 'notend') as boolean; // 是否有 notend 参数 const speaker = getSentenceArgByKey(sentence, 'speaker'); // 获取说话者