Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

unity image

//Make sure you are using UnityEngine.UI
using UnityEngine.UI

//We can assign this image in the inspector
public Image image;
//Also assign this in the inspector
public Sprite mySprite;

public void ChangeImage () 
{
	image.sprite = mySprite;
}
 
PREVIOUS NEXT
Tagged: #unity #image
ADD COMMENT
Topic
Name
4+9 =