瀏覽代碼

修复塔攻击会转身问题

WGL 3 月之前
父節點
當前提交
61a4750098

+ 0 - 10
ActionTowerDefense/Assets/Scripts/Tower/EnemyTower.cs

@@ -105,16 +105,6 @@ public class EnemyTower : Character
             case CharacterState.Attack:
                 attackController.attackTime = totalAttack_marchTime;
                 attackTarget = targetCharacter;
-                if ((attackTarget.transform.position - transform.position).x > 0
-                    && bodyTrans.localScale.x > 0)
-                {
-                    Turn();
-                }
-                else if ((attackTarget.transform.position - transform.position).x < 0
-                    && bodyTrans.localScale.x < 0)
-                {
-                    Turn();
-                }
                 Attack_March();
                 break;
             case CharacterState.Die:

+ 0 - 10
ActionTowerDefense/Assets/Scripts/Tower/Tower.cs

@@ -106,16 +106,6 @@ public class Tower : Character
             case CharacterState.Attack:
                 attackController.attackTime = totalAttack_marchTime;
                 attackTarget = targetCharacter;
-                if ((attackTarget.transform.position - transform.position).x > 0
-                    && bodyTrans.localScale.x > 0)
-                {
-                    Turn();
-                }
-                else if ((attackTarget.transform.position - transform.position).x < 0
-                    && bodyTrans.localScale.x < 0)
-                {
-                    Turn();
-                }
                 Attack_March();
                 break;
             case CharacterState.Die: