ソースを参照

玩家死亡后冻结在原地

SZAND\msx_2 6 ヶ月 前
コミット
b6bc320db2

+ 2 - 0
ActionTowerDefense/Assets/Scripts/Characters/PlayerController.cs

@@ -1781,6 +1781,7 @@ public class PlayerController : MoveCharacter
                     return;
                 }
                 isDie = false;
+                rb.constraints = RigidbodyConstraints.FreezePositionZ | RigidbodyConstraints.FreezeRotation;
                 break;
             case CharacterState.Conduct:
                 rb.isKinematic = false;
@@ -1889,6 +1890,7 @@ public class PlayerController : MoveCharacter
                 velocity = rushDir * rushSpeed;
                 break;
             case CharacterState.Die:
+                rb.constraints = RigidbodyConstraints.FreezeAll;
                 aniCollider.Play("Die", 0, 0);
                 ani.Play("die", 0, 0);
                 isDie = true;