This is the script:
All I want to do instantiate the object texture, and then have a reference to its sprite renderer.
public Transform texture;
public Transform texture;
void CreateGrid(/*int w, int h, int[] info, Vector2 offset*/){
GameObject refer = Instantiate(texture, Vector3.zero, Quaternion.identity, transform) as
GameObject;
SpriteRenderer sprite = refer.GetComponent<SpriteRenderer>();
}
![]()