SZAND\msx_2 hace 1 año
padre
commit
022d75aec3

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

@@ -149,6 +149,9 @@ public class PlayerController : MoveCharacter
     [Header("°ËØÔ")]
     public ChooseYinYang chooseYinYang;
 
+    [Header("Ëø»êËþ")]
+    public GameObject curSoulTower;
+
     public bool btnJumpPress
     {
         get

+ 7 - 0
ActionTowerDefense/Assets/Scripts/SoulTower/LockSoul.cs

@@ -7,6 +7,7 @@ public class LockSoul : MonoBehaviour
     public int maxLockSoul;
     private int nowLock;
     public List<Demonic> souls = new List<Demonic>();
+    public PlayerController pc;
 
     public void AddDenomic(Demonic d)
     {
@@ -35,8 +36,10 @@ public class LockSoul : MonoBehaviour
             if (c.ls == null)
             {
                 c.ls = this;
+                pc = other.GetComponentInParent<PlayerController>();
             }
             c.isInSoulTower = true;
+            pc.curSoulTower = gameObject;
         }
     }
 
@@ -78,6 +81,10 @@ public class LockSoul : MonoBehaviour
 
     public void ReleaseAllSouls()
     {
+        if (pc.curSoulTower == gameObject && pc.isInSoulTower)
+        {
+            pc.isInSoulTower = false;
+        }
         foreach(Demonic d in souls)
         {
             if (!d.isDie)