|
@@ -14,6 +14,8 @@ public class SoulBoom : MonoBehaviour
|
|
|
public List<MoveCharacter> characters = new List<MoveCharacter>(); //被炸到的对象
|
|
public List<MoveCharacter> characters = new List<MoveCharacter>(); //被炸到的对象
|
|
|
|
|
|
|
|
public bool canHitTower; //也对塔造成伤害
|
|
public bool canHitTower; //也对塔造成伤害
|
|
|
|
|
+ private bool isInVain; //击中光球,攻击无效
|
|
|
|
|
+ public Character owner;
|
|
|
|
|
|
|
|
private void Update()
|
|
private void Update()
|
|
|
{
|
|
{
|
|
@@ -65,12 +67,23 @@ public class SoulBoom : MonoBehaviour
|
|
|
|
|
|
|
|
private void OnTriggerEnter(Collider other)
|
|
private void OnTriggerEnter(Collider other)
|
|
|
{
|
|
{
|
|
|
|
|
+ Photosphere photosphere = other.GetComponentInParent<Photosphere>();
|
|
|
|
|
+ if (photosphere)
|
|
|
|
|
+ {
|
|
|
|
|
+ isInVain = true;
|
|
|
|
|
+ photosphere.Reflex(owner.beHitTrigger, attackInfo.damage);
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
BeHitTrigger beHitTrigger = other.GetComponent<BeHitTrigger>();
|
|
BeHitTrigger beHitTrigger = other.GetComponent<BeHitTrigger>();
|
|
|
if (beHitTrigger != null)
|
|
if (beHitTrigger != null)
|
|
|
{
|
|
{
|
|
|
if(other.transform.parent.parent.parent.gameObject.layer == 6
|
|
if(other.transform.parent.parent.parent.gameObject.layer == 6
|
|
|
|| other.transform.parent.parent.parent.gameObject.layer == 7)
|
|
|| other.transform.parent.parent.parent.gameObject.layer == 7)
|
|
|
{
|
|
{
|
|
|
|
|
+ if (other.transform.parent.parent.parent.gameObject.layer == 6 && isInVain)
|
|
|
|
|
+ {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
MoveCharacter character = other.GetComponentInParent<MoveCharacter>();
|
|
MoveCharacter character = other.GetComponentInParent<MoveCharacter>();
|
|
|
if (character.rb == null)
|
|
if (character.rb == null)
|
|
|
{
|
|
{
|