Browse Source

变身后飞行

LAPTOP-OM1V99U2\永远de小亡灵 1 year ago
parent
commit
3ddb353321

+ 2 - 2
ActionTowerDefense/Assets/Resources/Prefab/Player.prefab

@@ -963,8 +963,8 @@ Rigidbody:
   m_Mass: 1
   m_Drag: 0
   m_AngularDrag: 0.05
-  m_UseGravity: 0
-  m_IsKinematic: 1
+  m_UseGravity: 1
+  m_IsKinematic: 0
   m_Interpolate: 0
   m_Constraints: 120
   m_CollisionDetection: 1

+ 3 - 2
ActionTowerDefense/Assets/Resources/Prefab/Transfiguration/Trans_Invisible.prefab

@@ -218,7 +218,6 @@ MonoBehaviour:
   interval: 0.1
   lastSmokePos: {x: 0, y: 0, z: 0}
   time: 0
-  stayTime: 5
   normalSpeed: 0
   kMp: 1
   magnification: 0.5
@@ -335,7 +334,7 @@ MonoBehaviour:
   maxAttackDis: 0
   minAttackDis: 0
   needToChange: 0
-  canFly: 0
+  canFly: 1
   flyHeight: 0
   flyUpSpeed: 10
   sortingOrder: 1000
@@ -666,6 +665,8 @@ MonoBehaviour:
   repelValue: 0
   spiritsAttackEffect: {fileID: 0}
   offsetY: 1
+  hitRate: 1
+  Miss: {fileID: 0}
 --- !u!1 &7669620205589286043
 GameObject:
   m_ObjectHideFlags: 0

+ 3 - 1
ActionTowerDefense/Assets/Scripts/PlayerController.cs

@@ -1098,7 +1098,7 @@ public class PlayerController : MoveCharacter
             default:
                 break;
         }
-        if (!foot.TrigGround)
+        if (!foot.TrigGround && !canfly)
         {
             if (rb.velocity.y > 0)
             {
@@ -1431,6 +1431,7 @@ public class PlayerController : MoveCharacter
         {
             canfly = true;
             canJump = false;
+            rb.useGravity = false;
         }
         /*  ·¨Ê¦³ö³¡ÊͷŸ¡¿Õ³¡
         if (id == 3)
@@ -1454,6 +1455,7 @@ public class PlayerController : MoveCharacter
         isTransfiguration = false;
         canfly = false;
         canJump = true;
+        rb.useGravity = true;
         mecanim = playerMe;
         ani = playerAni;
         aniCollider = playerCol;

+ 0 - 2
ActionTowerDefense/Assets/Scripts/Spirits/Spirits_Invisible.cs

@@ -36,9 +36,7 @@ public class Spirits_Invisible : MonoBehaviour
         playerController.uiHp.gameObject.SetActive(false);
         playerController.isInvisible = true;
         playerController.mp += addMp;
-        playerController.canfly = true;
         normalSpeed = playerController.moveSpeed;
-       
         for (int i = 0;i < playerController.beTargetCharacter.Count; i++)
         {
             playerController.beTargetCharacter[i].targetCharacter = null;