@gamelearn/arcade-components 2.8.4 → 2.8.5
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.
|
@@ -152,6 +152,7 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
152
152
|
var talkingCharacter = currentLineData === null || currentLineData === void 0 ? void 0 : (_currentLineData$slot = currentLineData.slots) === null || _currentLineData$slot === void 0 ? void 0 : _currentLineData$slot.find(function (slot) {
|
|
153
153
|
return slot.talking;
|
|
154
154
|
});
|
|
155
|
+
var zoomStarted = (0, _react.useRef)(false);
|
|
155
156
|
var autoPlayCond = automatic && !(currentLineData !== null && currentLineData !== void 0 && currentLineData.decision);
|
|
156
157
|
var audio = Object.keys((currentLineData === null || currentLineData === void 0 ? void 0 : currentLineData.audio) || {}).length;
|
|
157
158
|
var voice = Object.keys((currentLineData === null || currentLineData === void 0 ? void 0 : currentLineData.voice) || {}).length;
|
|
@@ -680,7 +681,8 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
680
681
|
};
|
|
681
682
|
}, [currentMessage, nextLine, start, stop, currentLineData === null || currentLineData === void 0 ? void 0 : currentLineData.audioType, autoPlayCond, audio, voice, audioFailed]);
|
|
682
683
|
(0, _react.useEffect)(function () {
|
|
683
|
-
if (animationRunning) {
|
|
684
|
+
if (animationRunning && !zoomStarted.current) {
|
|
685
|
+
zoomStarted.current = true;
|
|
684
686
|
var cam = camera;
|
|
685
687
|
var targetPosition = messagePosition.current.child ? messagePosition.current.pos : defaultCamera.position.toArray();
|
|
686
688
|
animationTarget.current.position.fromArray(targetPosition);
|
|
@@ -701,6 +703,7 @@ var DialogComponent = function DialogComponent(_ref) {
|
|
|
701
703
|
duration: 1,
|
|
702
704
|
ease: 'power3.easeInOut',
|
|
703
705
|
onComplete: function onComplete() {
|
|
706
|
+
zoomStarted.current = false;
|
|
704
707
|
setAnimationRunning(false);
|
|
705
708
|
raycast.set(cam.getWorldPosition(new _three.Vector3(0, 0, 0)), cam.getWorldDirection(new _three.Vector3()));
|
|
706
709
|
var objects = raycast.intersectObjects(scene.children, true);
|