|
@@ -14,6 +14,8 @@ public class DashEffect : MonoBehaviour
|
|
|
public float targetY; //刀光的高度
|
|
public float targetY; //刀光的高度
|
|
|
public GameObject aim;
|
|
public GameObject aim;
|
|
|
public float offset;
|
|
public float offset;
|
|
|
|
|
+ public Character owner;
|
|
|
|
|
+ private bool isInVain; //击中光球,攻击无效
|
|
|
|
|
|
|
|
private void Awake()
|
|
private void Awake()
|
|
|
{
|
|
{
|
|
@@ -44,6 +46,13 @@ public class DashEffect : 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;
|
|
|
|
|
+ }
|
|
|
//作为己方冲刺可检测enemy
|
|
//作为己方冲刺可检测enemy
|
|
|
BeHitTrigger beHitTrigger = other.GetComponent<BeHitTrigger>();
|
|
BeHitTrigger beHitTrigger = other.GetComponent<BeHitTrigger>();
|
|
|
if(!isEnemy && beHitTrigger!=null&& other.transform.parent.parent.parent.gameObject.layer == 8 )
|
|
if(!isEnemy && beHitTrigger!=null&& other.transform.parent.parent.parent.gameObject.layer == 8 )
|
|
@@ -59,6 +68,10 @@ public class DashEffect : MonoBehaviour
|
|
|
if (isEnemy && beHitTrigger != null && (other.transform.parent.parent.parent.gameObject.layer == 6
|
|
if (isEnemy && beHitTrigger != null && (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;
|
|
|
|
|
+ }
|
|
|
Character character = other.GetComponentInParent<Character>();
|
|
Character character = other.GetComponentInParent<Character>();
|
|
|
if(!beHitTriggers.Exists(t => t == character))
|
|
if(!beHitTriggers.Exists(t => t == character))
|
|
|
{
|
|
{
|