瀏覽代碼

[ts][webgl] Fix drag-and-drop.js not setting animation.

Mario Zechner 3 年之前
父節點
當前提交
e436d873fa
共有 1 個文件被更改,包括 2 次插入3 次删除
  1. 2 3
      spine-ts/spine-webgl/example/drag-and-drop.js

+ 2 - 3
spine-ts/spine-webgl/example/drag-and-drop.js

@@ -21,7 +21,7 @@ class App {
         // Setup listener for animation selection box
         // Setup listener for animation selection box
         let animationSelectBox = document.body.querySelector("#animations");
         let animationSelectBox = document.body.querySelector("#animations");
         animationSelectBox.onchange = () => {
         animationSelectBox.onchange = () => {
-            // this.animationState.setAnimation(0, animationSelectBox.value, true);
+            this.animationState.setAnimation(0, animationSelectBox.value, true);
         }
         }
 
 
         // Setup listener for the PMA checkbox
         // Setup listener for the PMA checkbox
@@ -123,8 +123,7 @@ class App {
             option.selected = animation.name == animationName;
             option.selected = animation.name == animationName;
             animationSelectBox.appendChild(option);
             animationSelectBox.appendChild(option);
         }
         }
-
-        // if (animationName) this.animationState.setAnimation(0, animationName, true);
+        this.animationState.setAnimation(0, animationName, true);
 
 
         // Center the skeleton in the viewport
         // Center the skeleton in the viewport
         this.centerSkeleton();
         this.centerSkeleton();