示例#1
0
文件: Sensor.cs 项目: zhaojoestar/RRR
 /// <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);
             }
         }
     }
 }
示例#2
0
文件: Magic.cs 项目: zhaojoestar/RRR
 void DealEffect()
 {
     if (Target != null)
     {
         MagicMgr.DealMagic((ENUM_EFFECT)config.EffectType, config.EffectValue, Target);
     }
 }
示例#3
0
文件: Magic.cs 项目: zhaojoestar/RRR
 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);
         }
     }
 }