纳金网

标题: 代码创建GameObject报错:“Shader wants tangents, but the mesh doesn'... [打印本页]

作者: gogomercury    时间: 2014-1-12 10:11
标题: 代码创建GameObject报错:“Shader wants tangents, but the mesh doesn'...
错误为:

Shader wants tangents, but the mesh  doesn't have them


UnityEditor.DockArea:OnGUI()

我的代码为

MarkPictureObject = new GameObject();

MarkPictureObject.name = "MarkPicture";


MarkPictureObject.transform.parent = ThisGameObject.transform;


MarkPictureObject.transform.localScale = new Vector3(x,y,z);


MarkPictureObject.transform.localPosition = new Vector3(X, Y ,Z);

UISprite uisprite = MarkPictureObject.AddComponent<UISprite>();

uisprite.atlas = MyAtlas;

uisprite.spriteName = "MySprite";

尝试方法:
mesh.RecalculateNormals();

另外:
虽然有这个错误提示,但实际项目能正常运行。


作者: may    时间: 2014-1-12 10:43
提示这个shader需要Tangent,问题是mesh上面找不到?
作者: 我不再年轻    时间: 2014-1-12 14:58
应该是mesh问题




欢迎光临 纳金网 (http://old.narkii.com/club/) Powered by Discuz! X2.5