Exemple #1
0
        public bool HasColliderWithBorder(EDir dir, LVector2 fTargetHead, LFloat size)
        {
            LVector2 borderDir    = DirUtil.GetBorderDir(dir);
            var      fBorder1     = fTargetHead + borderDir * size;
            var      fBorder2     = fTargetHead - borderDir * size;
            var      isColHead    = HasCollider(fTargetHead);
            var      isColBorder1 = HasCollider(fBorder1);
            var      isColBorder2 = HasCollider(fBorder2);

            return(isColHead ||
                   isColBorder1 ||
                   isColBorder2);
        }
Exemple #2
0
        public List <LVector3Int> DebugQueryCollider(EDir dir, LVector2 fTargetHead, LFloat size)
        {
            var      ret          = new List <LVector3Int>();
            LVector2 borderDir    = DirUtil.GetBorderDir(dir);
            var      fBorder1     = fTargetHead + borderDir * size;
            var      fBorder2     = fTargetHead - borderDir * size;
            var      isColHead    = HasCollider(fTargetHead);
            var      isColBorder1 = HasCollider(fBorder1);
            var      isColBorder2 = HasCollider(fBorder2);

            ret.Add(new LVector3Int(fTargetHead.Floor().x, fTargetHead.Floor().y, isColHead ? 1 : 0));
            ret.Add(new LVector3Int(fBorder1.Floor().x, fBorder1.Floor().y, isColBorder1 ? 1 : 0));
            ret.Add(new LVector3Int(fBorder2.Floor().x, fBorder2.Floor().y, isColBorder2 ? 1 : 0));
            return(ret);
        }