1
Support / Re: Procedural Tile Map Issues
« on: October 20, 2013, 10:43:32 pm »
I'm just generating a static background--completely uninteractive in terms of collision. It just grows/shrinks overtime. Thanks for the heads up!
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
int oldHeight = map.height;
int oldWidth = map.width;
int newHeight = (map.height *= 2);
int newWidth = (map.width *= 2);
print (oldHeight + " " + oldWidth);
print (map.height + " " + map.width);
int tileCount = map.data.tilePrefabs.Length;
map.Build();
int a;
for(int i = 0; i < map.height - 1; i++) {
a = 0;
for(int z = 0; z < map.width - 1; z++) {
print (a);
a++;
if(map.GetTile(i,z,0) < 0)
map.SetTile(i,z,0,Random.Range(0,tileCount));
}
}
map.Build();