You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
private void GenerateObjects(string[] m)
{
for (int i = 0; i < 26; i++)
{
for (int j = 0; j < 26; j++)
{
Transform t = null;
if (m[i][j] == 'o')
{
t = Instantiate(wall, new Vector3(j - 13, 13 - (i + 1), 0), wall.rotation) as Transform;
}
else if (m[i][j] == 'Q')
{
t = Instantiate(iron, new Vector3(j - 13, 13 - (i + 1), 0), wall.rotation) as Transform;
}
else if (m[i][j] == 'b')
{
t = Instantiate(bush, new Vector3(j - 13, 13 - (i + 1), 0), wall.rotation) as Transform;
}
else if (m[i][j] == 'i')
{
t = Instantiate(ice, new Vector3(j - 13, 13 - (i + 1), 0), wall.rotation) as Transform;
}
else if (m[i][j] == 'w')
{
t = Instantiate(water, new Vector3(j - 13, 13 - (i + 1), 0), wall.rotation) as Transform;
}
if (m[i][j] != '.')
{
t.parent = generatedWallFolder;
}
}
}
}
Can you make a tool to convert specific png to this map.txt file?
I'm thinking of something like convert the png image to 26x26 (416x416 == 16x16) and read each block based on color
If the color is black then we add . if white then we add Q and so on..
I think this will work.
The text was updated successfully, but these errors were encountered:
This is converted by this method
Can you make a tool to convert specific png to this map.txt file?
I'm thinking of something like convert the png image to 26x26 (416x416 == 16x16) and read each block based on color
If the color is black then we add
.
if white then we addQ
and so on..I think this will work.
The text was updated successfully, but these errors were encountered: