Resources.Load
素材は、Resourcesにまとめて、スクリプトから名前を指定して呼び出す。
using UnityEngine; using System.Collections; using UnityEngine.UI; public class ResourceText : MonoBehaviour { private GameObject ImageObj; private const string ImageObjPath = "Image"; private void Awake (){ ImageObj = transform.FindChild (ImageObjPath).gameObject; } private void Start () { Debug.Log (ImageObj); ImageObj.GetComponent<Image> ().sprite = Resources.Load<Sprite> ("Image/gui_button_3"); } void Update () { } }