|
|
@@ -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;
|