Changing Image in unity by C# script
There are two case when you want to change image one is UI image and other is a sprite in scene so in this post we will take a look at both cases how to change images. Changing UI Image There are very few steps to change UI image scripts First create a UI image gameObject in scene whose image we want to change create a script and attach with an other empty gameObject and open script In script declare a public GameObject for referencing changing image and a declare a private Image variable for refencing Image component in this gameObject also declare a public Sprite for which image that we want in replacement. using System . Collections ; using System . Collections . Generic ; using UnityEngine ; using UnityEngine . UI ; public class test : MonoBehaviour { public GameObject image_object; public Sprite mySprite; private Ima...