示例#1
0
    List <BaseRoom> GetRoomInBounds(List <BaseRoom> rooms, BaseRoom room)
    {
        var inBoundsRoom = new List <BaseRoom>();
        var bound        = new Bounds();

        bound.size   = room.GetBounds()[0].size;
        bound.center = room.GetBounds()[0].center;
        //bound.Expand(-1f);
        for (int o = 0; o < rooms.Count; o++)
        {
            if (bound.Intersects(rooms[o].GetBounds()[0]))
            {
                inBoundsRoom.Add(rooms[o]);
            }
        }
        inBoundsRoom.Remove(room);
        return(inBoundsRoom);
    }