LAPTOP-OM1V99U2\永远de小亡灵 1 жил өмнө
parent
commit
975cc5b2df

+ 16 - 3
ActionTowerDefense/Assets/Scripts/Spirits/Trans_Assassin.cs

@@ -163,10 +163,22 @@ public class Trans_Assassin : MonoBehaviour
     }
     public void ReadyToDash(Vector2 leftDir)
     {
-        if(leftDir != Vector2.zero)
+        if(leftDir == Vector2.zero)
+        {
+            if (player.transform.localScale.x > 0)
+            {
+                targetDir = Vector3.right;
+            }
+            else
+            {
+                targetDir = Vector3.left;
+                
+            }
+
+        }
+        else
         {
             targetDir = leftDir.normalized;
-            
         }
 
 
@@ -229,7 +241,8 @@ public class Trans_Assassin : MonoBehaviour
             player.bodyTrans.rotation = Quaternion.Euler(new Vector3(0, 0, k));
         }
 
-
+        print(targetDir);
+        print(rushSpeed);
         player.rb.velocity = targetDir * rushSpeed;
     }
 }