@gamelearn/arcade-components 1.3.2 → 1.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/components/conversational-pro-component/components/ConversationalProComponent.js
CHANGED
|
@@ -123,13 +123,13 @@ var ConversationProViewer = function ConversationProViewer(_ref) {
|
|
|
123
123
|
return !decision ? getCurrentMessage() : {};
|
|
124
124
|
}, [getCurrentMessage, decision]);
|
|
125
125
|
var playSpeech = (0, _react.useCallback)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
|
|
126
|
-
var payload;
|
|
126
|
+
var payload, url;
|
|
127
127
|
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
128
128
|
while (1) {
|
|
129
129
|
switch (_context.prev = _context.next) {
|
|
130
130
|
case 0:
|
|
131
131
|
if (!(currentLineData.voice.id && currentMessage)) {
|
|
132
|
-
_context.next =
|
|
132
|
+
_context.next = 7;
|
|
133
133
|
break;
|
|
134
134
|
}
|
|
135
135
|
|
|
@@ -139,7 +139,7 @@ var ConversationProViewer = function ConversationProViewer(_ref) {
|
|
|
139
139
|
};
|
|
140
140
|
|
|
141
141
|
if (!(payload.voiceId && payload.text)) {
|
|
142
|
-
_context.next =
|
|
142
|
+
_context.next = 7;
|
|
143
143
|
break;
|
|
144
144
|
}
|
|
145
145
|
|
|
@@ -150,12 +150,16 @@ var ConversationProViewer = function ConversationProViewer(_ref) {
|
|
|
150
150
|
});
|
|
151
151
|
|
|
152
152
|
case 5:
|
|
153
|
+
url = _context.sent;
|
|
154
|
+
playSound(url);
|
|
155
|
+
|
|
156
|
+
case 7:
|
|
153
157
|
case "end":
|
|
154
158
|
return _context.stop();
|
|
155
159
|
}
|
|
156
160
|
}
|
|
157
161
|
}, _callee);
|
|
158
|
-
})), [currentLineData.voice, currentMessage, getVoice]); // Recupera la antigua linea de la conversacion para conservar los personajes en voice-over
|
|
162
|
+
})), [currentLineData.voice, currentMessage, getVoice, playSound]); // Recupera la antigua linea de la conversacion para conservar los personajes en voice-over
|
|
159
163
|
|
|
160
164
|
var leftWithSlots = lines.slice(0, currentLine + 1).reverse().find(function (line) {
|
|
161
165
|
return line.slots;
|
|
@@ -150,13 +150,13 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
150
150
|
return null;
|
|
151
151
|
}, [translate]);
|
|
152
152
|
var playSpeech = (0, _react.useCallback)( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
|
|
153
|
-
var payload;
|
|
153
|
+
var payload, url;
|
|
154
154
|
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
155
155
|
while (1) {
|
|
156
156
|
switch (_context.prev = _context.next) {
|
|
157
157
|
case 0:
|
|
158
158
|
if (!currentLine.voice.id) {
|
|
159
|
-
_context.next =
|
|
159
|
+
_context.next = 7;
|
|
160
160
|
break;
|
|
161
161
|
}
|
|
162
162
|
|
|
@@ -166,7 +166,7 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
166
166
|
};
|
|
167
167
|
|
|
168
168
|
if (!(payload.voiceId && payload.text)) {
|
|
169
|
-
_context.next =
|
|
169
|
+
_context.next = 7;
|
|
170
170
|
break;
|
|
171
171
|
}
|
|
172
172
|
|
|
@@ -177,12 +177,16 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
177
177
|
});
|
|
178
178
|
|
|
179
179
|
case 5:
|
|
180
|
+
url = _context.sent;
|
|
181
|
+
playSound(url);
|
|
182
|
+
|
|
183
|
+
case 7:
|
|
180
184
|
case "end":
|
|
181
185
|
return _context.stop();
|
|
182
186
|
}
|
|
183
187
|
}
|
|
184
188
|
}, _callee);
|
|
185
|
-
})), [currentLine === null || currentLine === void 0 ? void 0 : currentLine.voice, getVoice, currentMessage.text]);
|
|
189
|
+
})), [currentLine === null || currentLine === void 0 ? void 0 : currentLine.voice, getVoice, currentMessage.text, playSound]);
|
|
186
190
|
var getCurrentVisible = (0, _react.useCallback)(function (uid) {
|
|
187
191
|
var object;
|
|
188
192
|
scene.traverseVisible(function (node) {
|