@gamelearn/arcade-components 3.41.0 → 3.42.1

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.
@@ -32848,14 +32848,14 @@ function fX({ character: u, ttsStarted: t, active: e, onLoad: n }) {
32848
32848
  if (o) {
32849
32849
  if (u.animationId && ((y = u.animation) != null && y.url))
32850
32850
  return u.animation;
32851
- const O = u.emotion === "neutral" ? "idle" : c;
32851
+ const O = u.emotion === "neutral" ? "idle" : u.emotion;
32852
32852
  return (x = (A = (E = u == null ? void 0 : u.resource) == null ? void 0 : E.animations) == null ? void 0 : A[O]) != null && x.url ? (C = (T = u == null ? void 0 : u.resource) == null ? void 0 : T.animations) == null ? void 0 : C[O] : (M = (R = u == null ? void 0 : u.resource) == null ? void 0 : R.animations) == null ? void 0 : M.idle;
32853
32853
  }
32854
32854
  return {};
32855
32855
  }, [u.emotion, u == null ? void 0 : u.animationId, u == null ? void 0 : u.animation, (_ = u == null ? void 0 : u.resource) == null ? void 0 : _.animations, o]), d = Ut(() => {
32856
32856
  if (!l.current)
32857
32857
  return;
32858
- const y = l.current.userData.animator;
32858
+ const y = l.current.animator;
32859
32859
  if (!y)
32860
32860
  return;
32861
32861
  const E = y.getAction("talking");
@@ -32865,7 +32865,7 @@ function fX({ character: u, ttsStarted: t, active: e, onLoad: n }) {
32865
32865
  const y = l.current;
32866
32866
  if (!y)
32867
32867
  return;
32868
- const E = (O = (M = (R = u == null ? void 0 : u.resource) == null ? void 0 : R.animations) == null ? void 0 : M.talking) == null ? void 0 : O.url, x = ((L = (B = (N = u == null ? void 0 : u.resource) == null ? void 0 : N.animations) == null ? void 0 : B["talking-short"]) == null ? void 0 : L.url) || E, T = y.userData.animator;
32868
+ const E = (O = (M = (R = u == null ? void 0 : u.resource) == null ? void 0 : R.animations) == null ? void 0 : M.talking) == null ? void 0 : O.url, x = ((L = (B = (N = u == null ? void 0 : u.resource) == null ? void 0 : N.animations) == null ? void 0 : B["talking-short"]) == null ? void 0 : L.url) || E, T = y.animator;
32869
32869
  if (!T)
32870
32870
  return;
32871
32871
  const C = T.getAction("talking");
@@ -69054,7 +69054,7 @@ function Zet(u) {
69054
69054
  var y;
69055
69055
  const g = e.current.root, S = (y = e.current.howl) == null ? void 0 : y.node;
69056
69056
  if (g && S) {
69057
- const E = g.userData.animator;
69057
+ const E = g.animator;
69058
69058
  if (!E)
69059
69059
  return;
69060
69060
  const A = E.getAction("tts");
@@ -69093,7 +69093,7 @@ function Zet(u) {
69093
69093
  const E = Sg(m, t);
69094
69094
  if (!E)
69095
69095
  return !1;
69096
- const A = E.userData.animator;
69096
+ const A = E.animator;
69097
69097
  if (!A)
69098
69098
  return !1;
69099
69099
  const x = g["talking-short"] || g.talking, T = Po[x], C = $G(T), R = A.register("tts", C, E);
@@ -69102,7 +69102,7 @@ function Zet(u) {
69102
69102
  const _ = Sg(m, t);
69103
69103
  if (!_)
69104
69104
  return !1;
69105
- const g = _.userData.animator;
69105
+ const g = _.animator;
69106
69106
  if (!g)
69107
69107
  return !1;
69108
69108
  const S = g.getAction("tts");
@@ -69111,7 +69111,7 @@ function Zet(u) {
69111
69111
  i.forEach((m) => {
69112
69112
  const _ = t.getObjectByProperty("uid", m);
69113
69113
  if (_) {
69114
- const g = _.userData.animator;
69114
+ const g = _.animator;
69115
69115
  if (!g)
69116
69116
  return;
69117
69117
  const S = g.getAction("tts");
@@ -69122,7 +69122,7 @@ function Zet(u) {
69122
69122
  const S = Sg(m, t);
69123
69123
  if (Po[m] || (Po[m] = {}), !S)
69124
69124
  return new Promise((E) => E(!1));
69125
- const y = S.userData.animator;
69125
+ const y = S.animator;
69126
69126
  if (!y)
69127
69127
  return !1;
69128
69128
  if (_) {
@@ -69145,7 +69145,7 @@ function Zet(u) {
69145
69145
  const g = Sg(m, t);
69146
69146
  if (Po[m] || (Po[m] = {}), !g)
69147
69147
  return new Promise((y) => y(!1));
69148
- const S = g.userData.animator;
69148
+ const S = g.animator;
69149
69149
  if (!S)
69150
69150
  return !1;
69151
69151
  if (_ === "idle")
@@ -69644,8 +69644,10 @@ function nnt({ animation: u, loopTimes: t, onAnimationFinish: e, onAnimationSave
69644
69644
  if (r)
69645
69645
  n({ uid: i.uid, animation: u == null ? void 0 : u.id, index: f.index }), e();
69646
69646
  else {
69647
- const m = f.userData.animator, _ = () => {
69648
- const g = m.getAction(u.url);
69647
+ const m = f.animator;
69648
+ m || console.error("[Animation]: Current Object ", i.uid, " does not have an animator.");
69649
+ const _ = () => {
69650
+ const g = m == null ? void 0 : m.getAction(u.url);
69649
69651
  g.setLoop(YG, 1 / 0), g.reset();
69650
69652
  function S() {
69651
69653
  d.current += 1, d.current >= t && y();
@@ -69657,7 +69659,7 @@ function nnt({ animation: u, loopTimes: t, onAnimationFinish: e, onAnimationSave
69657
69659
  E && (d.current = 1, d.current >= t ? y() : m.addEventListener("loop", S));
69658
69660
  }), l(!0);
69659
69661
  };
69660
- m.getAction(u == null ? void 0 : u.url) ? (m.setTime(0), _()) : ent.load(
69662
+ m != null && m.getAction(u == null ? void 0 : u.url) ? (m.setTime(0), _()) : ent.load(
69661
69663
  u == null ? void 0 : u.url,
69662
69664
  (g) => {
69663
69665
  m.register(u == null ? void 0 : u.url, g.animations[0]), m.setTime(0), _();