Exemplo n.º 1
0
 /// <summary>
 /// 碰撞检测
 /// </summary>
 protected void OnTriggerEnter(Collider other)
 {
     if (CheckUnitType(other.gameObject))
     {
         //播放受击
         var ai = GetComponent <AIBase_Monster>();
         if (ai)
         {
             ai.OnHit();
         }
         if (Parent)
         {
             MagicMgr.DealMagic(ENUM_EFFECT.DAMAGE, Parent, other.gameObject);
         }
         //子弹处理
         Projectile bullet = gameObject.GetComponent <Projectile>();
         if (bullet)
         {
             if (bullet.Type == ENUM_PROJECTILE.NORMAL)
             {
                 Destroy(gameObject);
             }
         }
     }
 }
Exemplo n.º 2
0
 void DealEffect()
 {
     if (Target != null)
     {
         MagicMgr.DealMagic((ENUM_EFFECT)config.EffectType, config.EffectValue, Target);
     }
 }
Exemplo n.º 3
0
 void OnTriggerStay(Collider other)
 {
     Debug.Log(other.gameObject.name);
     if (isTrigger)
     {
         if (CheckSide(other.gameObject))
         {
             MagicMgr.DealMagic((ENUM_EFFECT)config.EffectType, config.EffectValue, other.gameObject);
         }
     }
 }