//仓库原型
var warehouse1:Sprite3D = scene.addChild(Sprite3D.load("model/warehouse/warehouse.lh")) as Sprite3D;
warehouse1.transform.rotate(new Laya.Vector3(0, 0, 0), false, false);
warehouse1.transform.translate(new Laya.Vector3(-25,0,0),false);
var warehouseMeshSprite3D1 :MeshSprite3D = warehouse1.getChildAt(0).getChildByName("Mesh1") as MeshSprite3D;
//添加盒型碰撞器
var boxCollider:BoxCollider = warehouseMeshSprite3D1.addComponent(BoxCollider) as BoxCollider;
boxCollider.setFromBoundBox(warehouseMeshSprite3D1.meshFilter.sharedMesh.boundingBox);
4 个回复
Aar0n
赞同来自: bing8310124
bing8310124
赞同来自:
bing8310124
赞同来自:
是这里的名字吗?
我改了后重新运行还是老错误
bing8310124
赞同来自: