public Image CreateTileBlock(Image _obj, Transform _transform, Color _color, DirectionType _direction) { var image = Instantiate(_obj, _transform); image.color = Color.blue; image.GetComponent<RectTransform>().SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, BlockSize - 2 * BlockBorderSize); image.GetComponent<RectTransform>().SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, BlockSize - 2 * BlockBorderSize); var position = _direction.GetVector() * BlockSize * 0.2f; _obj.GetComponent<RectTransform>().localPosition = position; return image; }