private void InitializeTile(int size, int i, int j, Texture2D image) { int id = (i * size) + (j + 1); var tile = CreateTile(); tile.Id = id; tile.gameObject.name = "[" + id + "]"; tile.gameObject.GetComponent <SpriteRenderer>().sprite = ImageCropper.Crop(image, size, j, i); }
public void ChangeImage(Texture2D image) { spriteRenderer.sprite = ImageCropper.Crop(image, 1, 0, 0); }