Selaa lähdekoodia

只有部分子弹能被传送门传送

LAPTOP-OM1V99U2\永远de小亡灵 1 vuosi sitten
vanhempi
commit
4d352045e7

+ 1 - 0
ActionTowerDefense/Assets/Scripts/Bullet.cs

@@ -34,6 +34,7 @@ public class Bullet : MonoBehaviour
     private bool hasBack = false;       //已经回来了
 
     [Header("传送门")]
+    public bool canTransmit;            //子弹是否能被传送门传送
     public bool haveTransmit;           //刚传送过
     [HideInInspector]
     public float transmitTime;          //传送CD

+ 1 - 1
ActionTowerDefense/Assets/Scripts/Portal/PortalsController.cs

@@ -30,7 +30,7 @@ public class PortalsController : MonoBehaviour
         }
         //´«ËÍ×Óµ¯
         Bullet bullet = other.GetComponent<Bullet>();
-        if(bullet != null)
+        if(bullet != null && bullet.canTransmit)
         {
             Rigidbody rb = bullet.GetComponentInParent<Rigidbody>();
             if (Transmit(rb))