yichael 3 лет назад
Родитель
Сommit
3f05cccdaa
1 измененных файлов с 16 добавлено и 2 удалено
  1. 16 2
      assets/Scripts/Game/PlayerController.js

+ 16 - 2
assets/Scripts/Game/PlayerController.js

@@ -70,10 +70,24 @@ cc.Class({
 
         if(this.gStatesScp.curretState == this.gStatesScp.finished) return;
         console.log('data.ename='+data.ename);
-        if(data.ename == 'hit')
+        if(data.direction == 'straightPunch')
         {
-            this.noDirectionPunch();
+            this.top();
         }
+
+        if(data.direction == 'leftPunch')
+        {
+            this.left();
+        }
+
+        if(data.direction == 'rightPunch')
+        {
+            this.right();
+        }
+        // else if(data.ename == 'hit')
+        // {
+        //     this.noDirectionPunch();
+        // }
     },
     //页面退出回调
     onQuit(data)