this.role = scene3D.getChildByName("Cube") as Laya.MeshSprite3D;
let phy: Laya.PhysicsCollider = this.role.addComponent(Laya.PhysicsCollider) as Laya.PhysicsCollider;
let mesh:Laya.Mesh = Laya.loader.getRes("res/Conventional/Library/unity default resources-Cube.lm");
let physhape: Laya.MeshColliderShape = new Laya.MeshColliderShape();
physhape.mesh = mesh;
phy.colliderShape = physhape;
1 个回复
Aar0n
赞同来自:
this.role = scene3D.getChildByName("Cube") as Laya.MeshSprite3D;
let phy: Laya.PhysicsCollider = this.role.addComponent(Laya.PhysicsCollider) as Laya.PhysicsCollider;
let mesh:Laya.Mesh = Laya.loader.getRes("res/Conventional/Library/unity default resources-Cube.lm");
let physhape: Laya.MeshColliderShape = new Laya.MeshColliderShape();
physhape.mesh = mesh;
phy.colliderShape = physhape;