佚名通过本文主要向大家介绍了mc没有texturepacks,texture,texture是什么意思,textureview,cg texture等相关知识,希望对您有所帮助,也希望大家支持linkedu.com www.linkedu.com
问题: 总提示texture没有初始化
描述:
我添加了texture 名字也改了 图片也加了 总提示texture没有初始化

解决方案1:
描述:
using UnityEngine;
using System.Collections;
public class x : MonoBehaviour {
public Texture2D texture;
// Use this for initialization
void OnGUI()
{
Rect rect = new Rect(Input.mousePosition.x - (texture.width/2),Screen.height - Input.mousePosition.y - (texture.height/2),texture.width, texture.height);
GUI.DrawTexture(rect, texture);
}
}
我添加了texture 名字也改了 图片也加了 总提示texture没有初始化

解决方案1:
你的图片应该是拉到你的脚本x上把, 不应该实在GUITexture 这个上。