@gamelearn/arcade-components 3.32.5 → 3.32.7

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.
@@ -29754,14 +29754,15 @@ function Panel({ character: l, ttsStarted: e, active: n, visible: t = !0, onLoad
29754
29754
  const g = useCallback(
29755
29755
  (y) => {
29756
29756
  if (l.type === "character") {
29757
- const C = y.getObjectByName("Head_M", !0);
29758
- C ? (C.updateMatrixWorld(!0), box.setFromObject(y), box.getSize(size), C.getWorldPosition(worldPos), o.current.lookAt(worldPos)) : o.current.position.setY(size.y - 1.5 * 1.3), o.current.zoom = 1.5;
29757
+ const w = y.getObjectByName("Head_M", !0);
29758
+ w ? (w.updateMatrixWorld(!0), box.setFromObject(y), box.getSize(size), w.getWorldPosition(worldPos), o.current.lookAt(worldPos)) : o.current.position.setY(size.y - 1.5 * 1.3), o.current.zoom = 1.5;
29759
+ const C = () => {
29760
+ _(!0), s == null || s(), y.removeEventListener("update_bounds", C);
29761
+ };
29762
+ y.addEventListener("update_bounds", C);
29759
29763
  } else
29760
- cameraFitAnyObject(y, o.current), o.current.zoom = 1;
29761
- const w = () => {
29762
- _(!0), s == null || s(), y.removeEventListener("update_bounds", w);
29763
- };
29764
- y.addEventListener("update_bounds", w), o.current.updateProjectionMatrix();
29764
+ cameraFitAnyObject(y, o.current), o.current.zoom = 1, _(!0);
29765
+ o.current.updateProjectionMatrix();
29765
29766
  },
29766
29767
  [l, s]
29767
29768
  );
@@ -61409,7 +61410,7 @@ function DialogComponent({
61409
61410
  }
61410
61411
  const activeCache = ProgressManager.request("AssetLoader").cache, assetLoader = new AssetLoader(void 0, activeCache);
61411
61412
  function Animation({ animation: l, loopTimes: e, onAnimationFinish: n, onAnimationSave: t, resource: s, makeDefault: o }) {
61412
- const [d, h] = useState(!1), f = useThree((p) => p.scene), u = useRef(1);
61413
+ const [d, h] = useState(!1), f = useThree((p) => p.scene), u = useRef(0);
61413
61414
  return useEffect(() => {
61414
61415
  h(!1);
61415
61416
  }, [s.uid, l == null ? void 0 : l.url]), useEffect(() => {
@@ -61423,16 +61424,19 @@ function Animation({ animation: l, loopTimes: e, onAnimationFinish: n, onAnimati
61423
61424
  const x = _.getAction(l.url);
61424
61425
  x.setLoop(LoopRepeat, 1 / 0), x.reset();
61425
61426
  function S() {
61426
- u.current += 1, u.current >= e && (_.mix("idle"), n(), _.removeEventListener("loop", S));
61427
+ u.current += 1, u.current >= e && g();
61428
+ }
61429
+ function g() {
61430
+ _.mix("idle"), n(), _.removeEventListener("loop", S);
61427
61431
  }
61428
- _.mix(l == null ? void 0 : l.url).then((g) => {
61429
- g && (u.current = 1, _.addEventListener("loop", S));
61432
+ _.mix(l == null ? void 0 : l.url).then((v) => {
61433
+ v && (u.current = 1, u.current >= e ? g() : _.addEventListener("loop", S));
61430
61434
  }), h(!0);
61431
61435
  };
61432
- _.getAction(l == null ? void 0 : l.url) ? T() : assetLoader.load(
61436
+ _.getAction(l == null ? void 0 : l.url) ? (_.setTime(0), T()) : assetLoader.load(
61433
61437
  l == null ? void 0 : l.url,
61434
61438
  (x) => {
61435
- _.register(l == null ? void 0 : l.url, x.animations[0]), T();
61439
+ _.register(l == null ? void 0 : l.url, x.animations[0]), _.setTime(0), T();
61436
61440
  },
61437
61441
  void 0,
61438
61442
  (x) => {