Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

display image script unity

public class Test : MonoBehaviour
{
    private Sprite img1;
    public GameObject MyImage;
 
    // Start is called before the first frame update
    void Start()
    {
        MyImage.AddComponent(typeof(Image));
        img1 = Resources.Load<Sprite>("ARInfo/Magazine1/1");
        MyImage.GetComponent<Image>().sprite = img1;
        Debug.Log("Test script started");
    }
}
 
PREVIOUS NEXT
Tagged: #display #image #script #unity
ADD COMMENT
Topic
Name
3+6 =