public Coord GetCoord() { if (!snap) { SetSnap(); } Vector2 gridPos = snap.gridSideLength == 0 ? Vector2.zero : (Vector2)snap.GetGridPosition() / snap.gridSideLength; Coord coord = new Coord((int)gridPos.y, (int)gridPos.x); return(coord); }
public Coord GetCoord() { if (!snap) { snap = GetComponent <ZST_SnapToGrid>(); } Vector2 gridPos = snap.gridSideLength == 0 ? Vector2.zero : (Vector2)snap.GetGridPosition() / snap.gridSideLength; Coord coord = new Coord((int)gridPos.y, (int)gridPos.x); return(coord); }