Exemplo n.º 1
0
    private void SnapToGrid()
    {
        int gridSize = tileFloor.GetGridSize();

        transform.position = new Vector3(
            tileFloor.GetGridPos().x *gridSize,
            transform.position.y,
            tileFloor.GetGridPos().y *gridSize
            );
        gameObject.name = tileFloor.GetGridPos().x.ToString() + ", " + tileFloor.GetGridPos().y.ToString();
    }