LAPTOP-OM1V99U2\永远de小亡灵 há 11 meses atrás
pai
commit
a0f56be394

+ 1 - 0
ActionTowerDefense/Assets/Resources/Prefab/Conduct/Photosphere.prefab

@@ -51,6 +51,7 @@ MonoBehaviour:
   stayTime: 10
   hp: 0
   bulletPrefab: {fileID: 7473170563405908938, guid: 78ed8700e43860e48b7bd70b4cbc14d3, type: 3}
+  rate: 1
 --- !u!1 &1373031044951819773
 GameObject:
   m_ObjectHideFlags: 0

+ 5 - 3
ActionTowerDefense/Assets/Scripts/Conduct/Photosphere.cs

@@ -6,10 +6,12 @@ public class Photosphere : MonoBehaviour
 {
     public PlayerController owner;
     public int conductId;
-    public float stayTime;
+    
+    [Header("停留时间")]public float stayTime;
     private float time;
-    public int hp;
+    [Header("吸收伤害")]public int hp;
     public GameObject bulletPrefab;
+    [Header("反伤率")] public float rate;
     private void Update()
     {
         time += Time.deltaTime;
@@ -25,7 +27,7 @@ public class Photosphere : MonoBehaviour
         hp -= damage;
         GameObject obj = Instantiate(bulletPrefab);
         Vector3 attackDir = (beHitTrigger.owner.beSearchTrigger.transform.position - transform.position).normalized;
-        obj.GetComponent<Bullet>().BeShoot(owner, transform.position, attackDir, damage, 0, false, 0, true, beHitTrigger.owner);
+        obj.GetComponent<Bullet>().BeShoot(owner, transform.position, attackDir, (int)(damage * rate), 0, false, 0, true, beHitTrigger.owner);
         if (hp <= 0)
         {
             owner.conductCanRelease[conductId] = true;