Skip to content

Instantly share code, notes, and snippets.

@TomoG29
Last active January 13, 2019 04:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TomoG29/6e6105eed7e4c642c9ecd1f51a9d3da0 to your computer and use it in GitHub Desktop.
Save TomoG29/6e6105eed7e4c642c9ecd1f51a9d3da0 to your computer and use it in GitHub Desktop.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class Sample : MonoBehaviour {
private Sprite image;
private Image draw;
void Start () {
image = Resources.Load<Sprite>("読み込みたい画像のパス");
gameObject.GetComponent<Image>().sprite = image;
draw.sprite = image;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment