- Home /
Question by
WhenDidIAskBruh · Sep 03, 2020 at 12:35 AM ·
tilesresizing
How to change somethings pixelsPerUnit in script?
private void Start()
{
for (int x = 0; x < floorTiles.Length; x++)
{
tileBeingResized = floorTiles[x];
tileBeingResized.pixelsPerUnit = tileBeingResized.pixelsPerUnit * (1 / tileLength);
}
LayOutTiles();
}
So I guess here's some suedo code for what I'm trying to do. I made procedural generation for tiles, but I thought they looked a little big. Instead of having to change the pixels per unit every single time I wanted to trial and error, I wanted one variable that I could change that would correctly scale everything. If there is a way to resize a tile, please let me know
Explanation of code: I have a array of floorTiles, and I run through every coordinate and place a random one down. That is in the function LayOutTiles(). I'm now trying to run through every tile in that array, and resize them before placing them.
Comment