我想从脚本中添加 GUITexture 但它是错误的,然后我尝试插入 GUITexture(从 GameObject > 创建其他 > GUI 纹理)然后将其链接到脚本,但是当我尝试使用 pixelInset 移动 guitexture 时,出现错误说
NullReferenceException UnityEngine.GUITexture.get_pixelInset () (在 C:/BuildAgent/work/d3d49558e4d408f4/artifacts/EditorGenerated/Graphics.cs:3254)
这是脚本
public GUITexture temp;
void Start () {
temp = new GUITexture ();
temp.pixelInset.Set (100,100,100,100);
}