Пример #1
0
 public virtual bool ActiveCollisionDetection(SkillCollision target)
 {
     if(IsActiveCollision(target))
     {
         return CollisionDetect(target);
     }
     return false;
 }
Пример #2
0
 public virtual bool ActiveCollisionDetection(SkillCollision target)
 {
     if (IsActiveCollision(target))
     {
         return(CollisionDetect(target));
     }
     return(false);
 }
Пример #3
0
 public virtual bool IsActiveCollision(SkillCollision targetCollision)
 {
     if (this.CollisionType == SkillCollisionType.None || targetCollision.CollisionType == SkillCollisionType.None)
     {
         return(false);
     }
     return(this.ActiveCollisions.ContainsKey(targetCollision.CollisionType) &&
            targetCollision.PassiveCollision.ContainsKey(this.CollisionType));
 }
Пример #4
0
        public bool CollisionDetect2DBox(SkillCollision target)
        {
            var deltaP2P = move.Position - target.move.Position;

            if (Math.Abs(deltaP2P.x) <= CollisionInfo.x + target.CollisionInfo.x &&
                Math.Abs(deltaP2P.y) <= CollisionInfo.y + target.CollisionInfo.y)
            {
                return(true);
            }
            return(false);
        }
Пример #5
0
        public bool CollisionDetect2DBox(SkillCollision target)
        {
            var deltaP2P = move.Position - target.move.Position;

            if(Math.Abs(deltaP2P.x) <= CollisionInfo.x + target.CollisionInfo.x &&
                Math.Abs(deltaP2P.y) <= CollisionInfo.y + target.CollisionInfo.y )
            {
                return true;
            }
            return false;
        }
Пример #6
0
        /// <summary>
        /// 这是一个在tank并不使用SkillBulletMove功能的情况下进行碰撞判断的方法
        /// </summary>
        /// <param name="target"></param>
        /// <returns></returns>
        public bool CollisionDetect2DBox_NoMove(SkillCollision target)
        {
            if (move != null && target.move != null)
            {
                return(CollisionDetect2DBox(target));
            }
            var pos    = Self.GetPos();
            var tarPos = target.Self.GetPos();

            if (Math.Abs(pos.x - tarPos.x) <= CollisionInfo.x + target.CollisionInfo.x &&
                Math.Abs(pos.z - tarPos.z) <= CollisionInfo.y + target.CollisionInfo.y)
            {
                return(true);
            }
            return(false);
        }
Пример #7
0
 public virtual bool CollisionDetect(SkillCollision target)
 {
     return(false);
 }
Пример #8
0
 public virtual bool IsPassiveCollision(SkillCollision sourceCollision)
 {
     return(sourceCollision.IsActiveCollision(this));
 }
Пример #9
0
 public override bool CollisionDetect(SkillCollision target)
 {
     return false;
 }
Пример #10
0
 public override bool CollisionDetect(SkillCollision target)
 {
     return CollisionDetect2DBox_NoMove(target);
 }
Пример #11
0
 public override bool CollisionDetect(SkillCollision target)
 {
     return(false);
 }
Пример #12
0
        /// <summary>
        /// 这是一个在tank并不使用SkillBulletMove功能的情况下进行碰撞判断的方法
        /// </summary>
        /// <param name="target"></param>
        /// <returns></returns>
        public bool CollisionDetect2DBox_NoMove(SkillCollision target)
        {
            if(move != null && target.move != null)
            {
                return CollisionDetect2DBox(target);
            }
            var pos = Self.GetPos();
            var tarPos = target.Self.GetPos();

            if (Math.Abs(pos.x - tarPos.x) <= CollisionInfo.x + target.CollisionInfo.x &&
                Math.Abs(pos.z - tarPos.z) <= CollisionInfo.y + target.CollisionInfo.y)
            {
                return true;
            }
            return false;
        }
Пример #13
0
 public virtual bool CollisionDetect(SkillCollision target)
 {
     return false;
 }
Пример #14
0
 public virtual bool IsPassiveCollision(SkillCollision sourceCollision)
 {
     return sourceCollision.IsActiveCollision(this);
 }
Пример #15
0
 public virtual bool IsActiveCollision(SkillCollision targetCollision)
 {
     if(this.CollisionType == SkillCollisionType.None || targetCollision.CollisionType == SkillCollisionType.None)
     {
         return false;
     }
     return this.ActiveCollisions.ContainsKey(targetCollision.CollisionType) &&
         targetCollision.PassiveCollision.ContainsKey(this.CollisionType);
 }
Пример #16
0
 public override bool CollisionDetect(SkillCollision target)
 {
     return(CollisionDetect2DBox_NoMove(target));
 }