1、自定义蒙层
var vertexDeclaration = Laya.VertexMesh.getVertexDeclaration("POSITION,NORMAL,UV");
var vertices = this.createVertexByNodes(nodes,depth);
var indices = this.createIndicesByNodes(nodes)
var mesh = Laya.PrimitiveMesh._createMesh(vertexDeclaration, vertices, indices);
var plane = new Laya.MeshSprite3D(mesh);
plane.meshRenderer.sharedMaterial = new Laya.BlinnPhongMaterial()
plane.meshRenderer.sharedMaterial.albedoColor = color
plane.meshRenderer.sharedMaterial.renderMode = Laya.BlinnPhongMaterial.RENDERMODE_TRANSPARENT;
//关闭材质的高光
plane.meshRenderer.sharedMaterial.specularColor = new Laya.Vector3(0,0,0);
let collider = plane.addComponent(Laya.PhysicsCollider)
let shape = new Laya.MeshColliderShape()
shape.mesh = mesh
collider.colliderShape = shape
2、 来自unity的空心的预制体
在unity中组合多个box collider实现