Эх сурвалжийг харах

离开平台后仍然有一点点时间可以进行跳跃,提升操作手感

wulifu 1 жил өмнө
parent
commit
2bd01de0e7

+ 9 - 1
ActionTowerDefense/Assets/Resources/Prefab/Player.prefab

@@ -180,12 +180,14 @@ MonoBehaviour:
   extraRiseGravity: -80
   extraFallGravity: -40
   jumpSpeed: 30
+  airJumpSpeed: 20
   maxMoveSpeed: 25
+  rushSpeed: 100
   state: 1
   invincibleTime: 0
   totalInvincibleTime: 2
   canJumpTime: 0
-  leaveGroundCanJumpTime: 0.1
+  leaveGroundCanJumpTime: 0.15
   cacheJumpTime: 0
   totalCacheJumpTime: 0.1
   hurtKeepTime: 0
@@ -199,8 +201,14 @@ MonoBehaviour:
   cacheSummonTime: 0
   totalCacheSummonTime: 0.1
   cacheSummonId: 0
+  rushTime: 0
+  totalRushTime: 0.2
+  cacheRushTime: 0
+  totalCacheRushTime: 0.1
+  airJumped: 0
   isDie: 0
   isClickBtnJump: 0
+  isClickBtnRush: 0
   isClickBtnSouth: 0
   isClickBtnEast: 0
   isClickBtnWest: 0

+ 0 - 8
ActionTowerDefense/Assets/Scenes/SampleScene.unity

@@ -863,14 +863,6 @@ PrefabInstance:
   m_Modification:
     m_TransformParent: {fileID: 0}
     m_Modifications:
-    - target: {fileID: 3571941038519084336, guid: 5b538f610930dd743a096c582e2810f4, type: 3}
-      propertyPath: airJumpSpeed
-      value: 20
-      objectReference: {fileID: 0}
-    - target: {fileID: 3571941038519084336, guid: 5b538f610930dd743a096c582e2810f4, type: 3}
-      propertyPath: totalRushTime
-      value: 0.2
-      objectReference: {fileID: 0}
     - target: {fileID: 3571941038519084344, guid: 5b538f610930dd743a096c582e2810f4, type: 3}
       propertyPath: m_Name
       value: Player

+ 5 - 5
ActionTowerDefense/Assets/Scripts/PlayerController.cs

@@ -487,15 +487,15 @@ public class PlayerController : MonoBehaviour
                 //}
                 if (btnJumpPress || cacheJumpTime > 0)
                 {
-                    if (!airJumped)
+                    if (canJumpTime > 0)
                     {
-                        airJumped = true;
-                        AirJump();
+                        Jump();
                         break;
                     }
-                    else if (canJumpTime > 0)
+                    else if (!airJumped)
                     {
-                        Jump();
+                        airJumped = true;
+                        AirJump();
                         break;
                     }
                 }