Parcourir la source

player初始位置可调

wgl il y a 7 mois
Parent
commit
81f2779005

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

@@ -898,6 +898,7 @@ MonoBehaviour:
   sustainedInjury_damage: 0
   heavyDamage: 100
   playerId: 0
+  pos: {x: 150, y: 0}
   canJump: 1
   endTranSummon: 1
   aniCollider: {fileID: 5072770566235913242}

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

@@ -35,6 +35,7 @@ public class PlayerController : MoveCharacter
 {
     [Header("玩家属性")]
     public int playerId;
+    public Vector2 pos;
     public bool canJump;
     public bool endTranSummon;  //是否在结束变身后召唤英灵
     public Animator aniCollider;
@@ -416,7 +417,7 @@ public class PlayerController : MoveCharacter
         PlayerInput playerInput = transform.GetComponent<PlayerInput>();
         spirits = GetComponent<Spirits>();
         playerId = playerInput.playerIndex;
-        transform.position = new Vector3(142 + 4 * playerId, 0, 0);
+        transform.position = new Vector3(pos.x, pos.y, 0);
         playerRope.playerId = playerId;
         sprintLinkTrigger.playerID = playerId;
         switch (playerId)