示例#1
0
    //检测是否与地形相邻
    public bool OnOtherSideOfTerrain(Vector2 conPos, float minAffectRadius)
    {
        //检测conPos是否进入影响距离
        if (Utils.DistLess(pos, conPos, minAffectRadius))
        {
            return(false);
        }
        if (owner.owner.room.GetTile(pos).Solid)
        {
            return(true);
        }
        IntVector2 intVec = IntVector2.ClampAtOne(owner.owner.room.GetTilePosition(conPos) - owner.owner.room.GetTilePosition(pos));

        if (intVec.x != 0 && intVec.y != 0)
        {
            if (Mathf.Abs(conPos.x - pos.x) > Mathf.Abs(conPos.y - pos.y))
            {
                intVec.y = 0;
            }
            else
            {
                intVec.x = 0;
            }
        }
        return(owner.owner.room.GetTile(owner.owner.room.GetTilePosition(pos) + intVec).Solid);
    }