【发布时间】:2016-04-28 01:03:03
【问题描述】:
在我在 Unity3d 中构建的应用程序中,我希望能够让用户为主面板选择背景图像。目前,当我调试变量时,我得到了空值。如果有人能指出我正确的方向。
public Image Background;
public Sprite theImage;
// Use this for initialization
void Start ()
{
theImage = Resources.Load<Sprite>("Sprites/sf1");
Debug.Log(theImage);
Background.GetComponent<Image>().sprite=theImage;
Debug.Log(theImage);
谢谢!
【问题讨论】:
标签: c# image unity3d background panel