Kaynağa Gözat

修复变身法师被浮空结束后无法吸收魂bug

SZAND\msx_2 1 yıl önce
ebeveyn
işleme
3755f433d7

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

@@ -247,11 +247,11 @@ public class MoveCharacter : Character
                 curFallSpeed = normalFallSpeed;
                 if (gameObject.tag == "Player")
                 {
-                    GetComponent<PlayerController>().soulCollector.enabled = true;
-                }
-                if (isTran)
-                {
-                    GetComponent<Demonic>().soulCollector.enabled = true;
+                    if (pc == null)
+                    {
+                        pc = GetComponentInParent<PlayerController>();
+                    }
+                    pc.soulCollector.enabled = true;
                 }
             }
         }

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

@@ -1397,8 +1397,11 @@ public class PlayerController : MoveCharacter
         return velocity;
     }
 
+    private Collider playerSoulCollector;
+    
     public void Transfiguration(int id) //񄐡
     {
+        playerSoulCollector = soulCollector;
         id = id - 3;
         if (id >= changePrefabs.Count)
         {
@@ -1456,6 +1459,7 @@ public class PlayerController : MoveCharacter
         spinee = dem.spinee;
         mesh = dem.mesh;
         mats = dem.mats;
+        soulCollector = dem.soulCollector;
         outlineMats = dem.outlineMats;
         if (dem.canFly)
         {
@@ -1502,6 +1506,7 @@ public class PlayerController : MoveCharacter
         spinee = playerSpinee;
         mesh = playerMesh;
         mats = playerMats;
+        soulCollector = playerSoulCollector;
         outlineMats = playerOut;
         bodyTrans.gameObject.SetActive(true);
         uiHp.gameObject.SetActive(true);