コード例 #1
0
        // Token: 0x06000042 RID: 66 RVA: 0x00003E80 File Offset: 0x00002080
        public static PrototypeDungeonRoom CreateRoomFromTexture(Texture2D texture)
        {
            int width  = texture.width;
            int height = texture.height;
            PrototypeDungeonRoom newPrototypeDungeonRoom = RoomFactory.GetNewPrototypeDungeonRoom(width, height);

            PrototypeDungeonRoomCellData[] array = RoomFactory.m_cellData.GetValue(newPrototypeDungeonRoom) as PrototypeDungeonRoomCellData[];
            array = new PrototypeDungeonRoomCellData[width * height];
            for (int i = 0; i < width; i++)
            {
                for (int j = 0; j < height; j++)
                {
                    array[i + j * width] = RoomFactory.CellDataFromColor(texture.GetPixel(i, j));
                }
            }
            RoomFactory.m_cellData.SetValue(newPrototypeDungeonRoom, array);
            newPrototypeDungeonRoom.name = texture.name;
            return(newPrototypeDungeonRoom);
        }