ソースを参照

降低移动速度 和 跳跃高度

zhengchen 1 年間 前
コミット
8c32e02697

+ 12 - 4
Assets/Scripts/Comp/BattleMainComp.cs

@@ -59,14 +59,22 @@ namespace Comp
             if (localPlayerId == obj.fromPlayer)
             {
                 localPlayer = new GamePlayer()
-                    { cockId = obj.fromCock, playerId = obj.fromPlayer, hp = obj.fromPlayerHp };
-                antiPlayer = new GamePlayer() { cockId = obj.toCock, playerId = obj.toPlayer, hp = obj.toPlayerHp };
+                {
+                    cockId = obj.fromCock, playerId = obj.fromPlayer, hp = obj.fromPlayerHp,
+                    runTimeHp = obj.fromPlayerHp
+                };
+                antiPlayer = new GamePlayer()
+                    { cockId = obj.toCock, playerId = obj.toPlayer, hp = obj.toPlayerHp, runTimeHp = obj.toPlayerHp };
             }
             else
             {
-                localPlayer = new GamePlayer() { cockId = obj.toCock, playerId = obj.toPlayer, hp = obj.toPlayerHp };
+                localPlayer = new GamePlayer()
+                    { cockId = obj.toCock, playerId = obj.toPlayer, hp = obj.toPlayerHp, runTimeHp = obj.toPlayerHp };
                 antiPlayer = new GamePlayer()
-                    { cockId = obj.fromCock, playerId = obj.fromPlayer, hp = obj.fromPlayerHp };
+                {
+                    cockId = obj.fromCock, playerId = obj.fromPlayer, hp = obj.fromPlayerHp,
+                    runTimeHp = obj.fromPlayerHp
+                };
             }
 
             Debug.Log("local player is " + localPlayer.playerId + "==== anti player is " + antiPlayer.playerId);

+ 4 - 4
Assets/Scripts/Comp/CockMoveComp.cs

@@ -13,14 +13,14 @@ namespace Comp
 
         private float _movingTime; // 水平运动时间
 
-        private const float MovingSpeed = 0.6f; // 移动速度
+        private const float MovingSpeed = 0.5f; // 移动速度
 
-        private const float MovingTime = 0.8f; // 移动时间
+        private const float MovingTime = 0.6f; // 移动时间
 
         // 跳跃相关
-        private const float HighJumpSpeed = 3f; // 高跳速度
+        private const float HighJumpSpeed = 2.4f; // 高跳速度
 
-        private const float LowJumpSpeed = 2.5f; // 低跳速度
+        private const float LowJumpSpeed = 2f; // 低跳速度
 
         private Vector3 CreateMovingVector(float speed)
         {

+ 9 - 25
Assets/Scripts/Game/GameCore.cs

@@ -9,21 +9,13 @@ namespace Game
 {
     public class GameCore : RdSingletonStateMachine<GameState, GameCore>
     {
-        [RdReset] public GameState pendingState;
+        [RdReset] public GameState pendingState, battleState, liftState, endState;
 
-        [RdReset] public GameState battleState;
+        [RdReset] public GamePlayer localPlayer, antiPlayer;
 
-        [RdReset] public GameState liftState;
+        [RdReset] public int winPlayerId, diamond;
 
-        [RdReset] public GameState endState;
-
-        [RdReset] public GamePlayer localPlayer;
-
-        [RdReset] public GamePlayer antiPlayer;
-
-        [RdReset] public int winPlayerId;
-
-        [RdReset] public int diamond;
+        // 存储组件的容器
 
         [RdReset] public Dictionary<int, CockActionComp> cockActionComps;
 
@@ -31,13 +23,13 @@ namespace Game
 
         [RdReset] public Dictionary<int, MasterActionComp> masterDict;
 
-        [RdReset] public GameObject parent;
+        // 需要用到的GameObject
 
-        [RdReset] public BattleMainComp battleMainComp;
+        [RdReset] public GameObject parent, camera, resultPanel;
 
-        [RdReset] public GameObject camera;
+        [RdReset] public BattleMainComp battleMainComp;
 
-        [RdReset] public GameObject resultPanel;
+        // 游戏运行数据
 
         [RdReset] public LinkedList<BattleDetailObj> battleDetailObjs;
 
@@ -47,10 +39,8 @@ namespace Game
 
         [RdReset(2)] public int liftTimes;
 
-        [RdReset] public bool inBattleState = false;
-
         [RdReset(true)] public bool showResultPanel = true;
-
+        
         public GameCore()
         {
         }
@@ -96,12 +86,6 @@ namespace Game
             Start();
         }
 
-        public override void TransitionToState(GameState nextState)
-        {
-            inBattleState = nextState == battleState;
-            base.TransitionToState(nextState);
-        }
-
         protected override void Start()
         {
             TransitionToState(pendingState);

+ 2 - 0
Assets/Scripts/Game/GamePlayer.cs

@@ -12,6 +12,8 @@ namespace Game
 
         public int hp;
 
+        public int runTimeHp;
+
         public bool IsLocalPlayer()
         {
             return false;

ファイルの差分が大きいため隠しています
+ 8 - 692
Assets/TextMesh Pro/Resources/Fonts & Materials/LiberationSans SDF - Fallback.asset


この差分においてかなりの量のファイルが変更されているため、一部のファイルを表示していません