Beispiel #1
0
 /// <summary>
 /// 判断攻击者的攻击框和防御者的防御框是否重合
 /// </summary>
 /// <param name="attacker"></param>
 /// <param name="defender"></param>
 /// <returns></returns>
 private static bool IsHitSuccess(ComplexCollider attacker, ComplexCollider defender)
 {
     for (int i = 0; i < attacker.AttackClsnsLength; i++)
     {
         var attackClsn = attacker.AttackClsns[i];
         for (int j = 0; j < defender.DefenceClsnsLength; j++)
         {
             var         defenceClsn = defender.DefenceClsns[j];
             ContactInfo contactInfo;
             if (PhysicsUtils.RectColliderIntersectTest(attackClsn, defenceClsn, out contactInfo))
             {
                 return(true);
             }
         }
     }
     return(false);
 }
Beispiel #2
0
 public virtual bool IsIntersect(Collider c, out ContactInfo contactInfo)
 {
     contactInfo = null;
     return(PhysicsUtils.IsIntersect(this, c, out contactInfo));
 }