[LayaAirIDE 2.0]TypeError: Cannot set property 'material' of undefined
this.unit3D = Laya.Loader.getRes("Unity/Unit.lh") as Laya.MeshSprite3D;
this.scene3D.addChild(this.unit3D);
this.unit3D.transform.localScale = new Laya.Vector3(1, 1, 1);
this.unit3D.transform.translate(new Laya.Vector3(0, 0, 0));
var material:Laya.UnlitMaterial = Laya.Loader.getRes("Unity/Assets/Materials/Materials.lmat") as Laya.UnlitMaterial;
var unlitTexture:Laya.Texture2D = Laya.Loader.getRes("Images/BG_PopWindow.png") as Laya.Texture2D;
material.albedoTexture = unlitTexture;
this.unit3D.meshRenderer.material = material;
this.scene3D.addChild(this.unit3D);
this.unit3D.transform.localScale = new Laya.Vector3(1, 1, 1);
this.unit3D.transform.translate(new Laya.Vector3(0, 0, 0));
var material:Laya.UnlitMaterial = Laya.Loader.getRes("Unity/Assets/Materials/Materials.lmat") as Laya.UnlitMaterial;
var unlitTexture:Laya.Texture2D = Laya.Loader.getRes("Images/BG_PopWindow.png") as Laya.Texture2D;
material.albedoTexture = unlitTexture;
this.unit3D.meshRenderer.material = material;
没有找到相关结果
已邀请:
要回复问题请先登录
0 个回复