Ver código fonte

飞行单位可以被击落

LAPTOP-OM1V99U2\永远de小亡灵 11 meses atrás
pai
commit
9dea6f2cf9

+ 7 - 1
ActionTowerDefense/Assets/Resources/Prefab/Demonic_Arrow.prefab

@@ -994,6 +994,8 @@ MonoBehaviour:
   invincibleTime: 0
   injuryNumText: {fileID: 6467251191553420251, guid: 9b37289f93ea76745ab2cefb79a93e3c, type: 3}
   showInjuryNum: 0
+  ls: {fileID: 0}
+  isInSoulTower: 0
   totalDieKeepTime: 0
   dieKeepTime: 0
   canHitFly: 1
@@ -1104,6 +1106,7 @@ MonoBehaviour:
   sustainedInjuryTime: 0
   sustainedInjury_IntervalTime: 0
   sustainedInjury_damage: 0
+  heavyDamage: 0
   player: {fileID: 0}
   playerID: 0
   id: 0
@@ -1115,6 +1118,9 @@ MonoBehaviour:
   flyUpSpeed: 10
   baseSortingOrder: 6000
   runSpeed: 0
+  isReturnSoulTower: 0
+  origSoulPos: {x: 0, y: 0, z: 0}
+  isRecorded: 0
   searchState: 0
   soulCollector: {fileID: 0}
   attackDistance: 10
@@ -1141,5 +1147,5 @@ Rigidbody:
   m_UseGravity: 0
   m_IsKinematic: 0
   m_Interpolate: 0
-  m_Constraints: 124
+  m_Constraints: 120
   m_CollisionDetection: 0

+ 3 - 1
ActionTowerDefense/Assets/Resources/Prefab/ESpirits_Float.prefab

@@ -998,7 +998,7 @@ Rigidbody:
   m_UseGravity: 0
   m_IsKinematic: 0
   m_Interpolate: 0
-  m_Constraints: 124
+  m_Constraints: 120
   m_CollisionDetection: 0
 --- !u!114 &3755986111268942620
 MonoBehaviour:
@@ -1033,6 +1033,8 @@ MonoBehaviour:
   invincibleTime: 0
   injuryNumText: {fileID: 6467251191553420251, guid: 9b37289f93ea76745ab2cefb79a93e3c, type: 3}
   showInjuryNum: 1
+  ls: {fileID: 0}
+  isInSoulTower: 0
   totalDieKeepTime: 0
   dieKeepTime: 0
   canHitFly: 1

+ 4 - 1
ActionTowerDefense/Assets/Resources/Prefab/Enemy_Arrow.prefab

@@ -994,6 +994,8 @@ MonoBehaviour:
   invincibleTime: 0
   injuryNumText: {fileID: 6467251191553420251, guid: 9b37289f93ea76745ab2cefb79a93e3c, type: 3}
   showInjuryNum: 1
+  ls: {fileID: 0}
+  isInSoulTower: 0
   totalDieKeepTime: 0
   dieKeepTime: 0
   canHitFly: 1
@@ -1104,6 +1106,7 @@ MonoBehaviour:
   sustainedInjuryTime: 0
   sustainedInjury_IntervalTime: 0
   sustainedInjury_damage: 0
+  heavyDamage: 0
   id: 0
   baseSortingOrder: 5000
   canFly: 1
@@ -1156,5 +1159,5 @@ Rigidbody:
   m_UseGravity: 0
   m_IsKinematic: 0
   m_Interpolate: 0
-  m_Constraints: 124
+  m_Constraints: 120
   m_CollisionDetection: 0

+ 6 - 1
ActionTowerDefense/Assets/Resources/Prefab/MySpirit/Spirits_Float.prefab

@@ -1012,6 +1012,8 @@ MonoBehaviour:
   invincibleTime: 0
   injuryNumText: {fileID: 6467251191553420251, guid: 9b37289f93ea76745ab2cefb79a93e3c, type: 3}
   showInjuryNum: 0
+  ls: {fileID: 0}
+  isInSoulTower: 0
   totalDieKeepTime: 2
   dieKeepTime: 0
   canHitFly: 1
@@ -1135,6 +1137,9 @@ MonoBehaviour:
   flyUpSpeed: 10
   baseSortingOrder: 8000
   runSpeed: 0
+  isReturnSoulTower: 0
+  origSoulPos: {x: 0, y: 0, z: 0}
+  isRecorded: 0
   searchState: 0
   soulCollector: {fileID: 0}
   attackDistance: 10
@@ -1161,5 +1166,5 @@ Rigidbody:
   m_UseGravity: 0
   m_IsKinematic: 0
   m_Interpolate: 0
-  m_Constraints: 124
+  m_Constraints: 120
   m_CollisionDetection: 0

+ 6 - 10
ActionTowerDefense/Assets/Scripts/Enemy.cs

@@ -447,17 +447,13 @@ public class Enemy : MoveCharacter
                         aniCollider.Play("Hurt",0,0);
                     }
                     Vector3 vel = rb.velocity;
-                    if (!canFly)
+                    if (foot.TrigGround && vel.y <= 0)
                     {
-                        if (foot.TrigGround && vel.y < 0)
-                        {
-                            vel.y = 0;
-                        }
-                        else
-                        {
-                            vel += Vector3.up * extraFallGravity * Time.deltaTime;
-                        }
-                        
+                        vel = Vector3.zero;
+                    }
+                    else
+                    {
+                        vel += Vector3.up * extraFallGravity * Time.deltaTime;
                     }
 
                     vel.y = vel.y * (1 - decelerationRatio * Time.deltaTime);