A. Shears
A. Shears

Reputation: 115

Set sprite of Image to default None

I have a project where I have an image on the screen that starts blank and then an image gets placed as the sprite. I was wonder how to make the sprite to return to being None like it is by default. Thanks

Upvotes: 3

Views: 21293

Answers (1)

Programmer
Programmer

Reputation: 125455

Simply set it to null to make it blank again.

If Image:

public Image  image;
image.sprite = null;

If RawImage:

public RawImage  image;
image.texture = null;

Upvotes: 14

Related Questions