0
我在我的游戏中有一个触发器,并且想要在玩家进入特定区域时更改纹理。我已经设置了触发器,但无法让waal(对象)的图像发生改变?如何通过触发器将对象的纹理更改为新纹理
这里是代码我使用:
var Wall1: GameObject; \\Existing Game Object
var wall1TC: Texture; \\Texture to change Existing Game Object to.
function OnTriggerEnter() {
GetComponent.<Renderer>().material.mainTexture = Resources.Load("Wall_New_Texture", Texture);
}
不知道我做错了吗?
有人可以帮忙吗?
感谢
哇!谢谢!它现在正在工作!简直不敢相信! – Allrounder
您最欢迎的:) –