xushiting 3 years ago
parent
commit
58660f355a
1 changed files with 47 additions and 15 deletions
  1. 47 15
      src/XAnimationController.js

+ 47 - 15
src/XAnimationController.js

@@ -257,21 +257,53 @@ export default class XAnimationController {
             startFrame: b,
             endFrame: k
         };
-        c == 0 ? this.iBodyAnim == null ? this.iBodyAnim = j : (this.iBodyAnim.name = o,
-        this.iBodyAnim.skType = this._avatar.avatarType,
-        this.iBodyAnim.loop = s,
-        this.iBodyAnim.playSpeed = _,
-        this.iBodyAnim.currentFrame = 0,
-        this.iBodyAnim.startFrame = b,
-        this.iBodyAnim.endFrame = k) : c == 1 && (this.iFaceAnim == null ? this.iFaceAnim = j : (this.iFaceAnim.name = o,
-        this.iFaceAnim.skType = this._avatar.avatarType,
-        this.iFaceAnim.loop = s,
-        this.iFaceAnim.playSpeed = _,
-        this.iFaceAnim.currentFrame = 0,
-        this.iFaceAnim.startFrame = b,
-        this.iFaceAnim.endFrame = k)),
-        this.onPlay = o,
-        this.loop = s
+
+        if(c == 0){
+            if(this.iBodyAnim == null){
+                this.iBodyAnim = j
+            }
+            else{
+                this.iBodyAnim.name = o;
+                this.iBodyAnim.skType = this._avatar.avatarType;
+                this.iBodyAnim.loop = s;
+                this.iBodyAnim.playSpeed = _;
+                this.iBodyAnim.currentFrame = 0;
+                this.iBodyAnim.startFrame = b;
+                this.iBodyAnim.endFrame = k;
+            }
+        }
+        else if(c == 1){
+            if(this.iFaceAnim == null){
+                this.iFaceAnim = j
+            }
+            else{
+                this.iFaceAnim.name = o;
+                this.iFaceAnim.skType = this._avatar.avatarType;
+                this.iFaceAnim.loop = s;
+                this.iFaceAnim.playSpeed = _;
+                this.iFaceAnim.currentFrame = 0;
+                this.iFaceAnim.startFrame = b;
+                this.iFaceAnim.endFrame = k;
+            }
+        }
+
+        this.onPlay = o;
+        this.loop = s;
+        // c == 0 ? this.iBodyAnim == null ? this.iBodyAnim = j : (this.iBodyAnim.name = o,
+        // this.iBodyAnim.skType = this._avatar.avatarType,
+        // this.iBodyAnim.loop = s,
+        // this.iBodyAnim.playSpeed = _,
+        // this.iBodyAnim.currentFrame = 0,
+        // this.iBodyAnim.startFrame = b,
+        // this.iBodyAnim.endFrame = k) : c == 1 && (this.iFaceAnim == null ? this.iFaceAnim = j : (this.iFaceAnim.name = o,
+        // this.iFaceAnim.skType = this._avatar.avatarType,
+        // this.iFaceAnim.loop = s,
+        // this.iFaceAnim.playSpeed = _,
+        // this.iFaceAnim.currentFrame = 0,
+        // this.iFaceAnim.startFrame = b,
+        // this.iFaceAnim.endFrame = k)),
+        // this.onPlay = o,
+        // this.loop = s
     }
     _isAnimate() {
         var o;