Fix tile indexing

This commit is contained in:
Andrew Cassidy 2020-06-08 01:56:24 -07:00
parent c4c5177908
commit 1dddb97ca9
2 changed files with 1 additions and 2 deletions

View File

@ -212,10 +212,9 @@ namespace ConformalDecals.MaterialModifiers {
public void UpdateTile(int index, Vector2 tileSize) {
int tileCountX = (int) (_mainTexture.Width / tileSize.x);
int tileCountY = (int) (_mainTexture.Height / tileSize.y);
int x = index % tileCountX;
int y = index / tileCountY;
int y = index / tileCountX;
var tile = new Rect(x * tileSize.x, y * tileSize.y, tileSize.x, tileSize.y);