• 首页
  • 动态
  • 案例
  • 引擎社区
  • API
  • 文档
  • 示例
  • 引擎下载

大约有 416 项符合查询结果, 库内数据总量为 30,724 项。 (搜索耗时: 0.0041 秒)

11. [LayaAir3]addComponent(Laya.Rigidbody3D); 报错 [ 97%]

[LayaAir3]addComponent(Laya.Rigidbody3D); 报错 //组件被启用后执行,例如节点被添加到舞台后     onEnable(): void {         let a = this.owner.getChildByName("Sprite3D") as Laya.Sprite3D;         console.log(a,typeof(a))         let aa = a.addComponent(Laya.Rigidbod...

来源: Laya_社区 发布时间: 20240102

12. addComponent后成功加载了自定义Script,但是无法执行到script的onEnable,onUpdate等方法 [ 96%]

addComponent后成功加载了自定义Script,但是无法执行到script的onEnable,onUpdate等方法 我之前有个老版本的工程,转到新的2.0版本后一切正常,打算用组件的方式尝试一下开发,写了个最简单的隔多少帧自动销毁的Script,只是在onUpda...

来源: Laya_社区 发布时间: 20181122

13. 3D基础显示对象 · LayaAir3.0文档 · LAYABOX [ 95%]

...如下: /* 立方体 */ let box = new Laya.Sprite3D; let boxMesh = box.addComponent(Laya.MeshFilter); let boxRender = box.addComponent(Laya.MeshRenderer); // 创建网格 boxMesh.sharedMesh = Laya.PrimitiveMesh.createBox(0.5, 0.5, 0.5); // 创建材质 let boxMaterial: Laya.BlinnPhongMaterial = ne...

来源: Laya3.0_文档 发布时间: 20240624

14. 射线检测-碰撞器混合 [ 93%]

...ra.transform.rotate(new Laya.Vector3(-15, 0, 0), true, false); this.camera.addComponent(CameraMoveScript); //加载猴子 this.layaMonkey = this.scene.addChild(Laya.Sprite3D.load("../../res/threeDimen/skinModel/LayaMonkey/LayaMonkey.lh")); this.layaMonkey.transform.position = new Laya.Vector3(0, 0, ...

来源: Laya_示例 发布时间: 20241001

15. RopeJoint代码动态创建 无法设置otherbody等属性 [ 92%]

...ight-256)/2-50; //添加到舞台 Laya.stage.addChild(img2); sp=img2; img2.addComponent(BoxCollider); (img2.getComponent(BoxCollider) as BoxCollider).width=256; (img2.getComponent(BoxCollider) as BoxCollider).height=256; img2.addComponent(RigidBody); img.addComponent(BoxCollider); (img.getComponent(...

来源: Laya_社区 发布时间: 20200217

16. 2D物理-碰撞事件与传感器 [ 91%]

... let groundBody = new Laya.RigidBody(); groundBody.type = "static"; ground.addComponentIntance(groundBody); let chainCollider = ground.addComponent(Laya.ChainCollider); chainCollider.points = "50,400,50,600,1050,600,1050,400"; let sensorCollider = this.sensorCollider = ground.addComponent(Laya.Circl...

来源: Laya2.0_示例 发布时间: 20241001

17. 射线检测-选取物体 [ 90%]

....9, 0.9, 1); plane.meshRender.material = planeMat; var boxCollider = plane.addComponent(Laya.BoxCollider); boxCollider.setFromBoundBox(plane.meshFilter.sharedMesh.boundingBox); plane.name = "平面"; //正方体 var box = scene.addChild(new Laya.MeshSprite3D(new Laya.BoxMesh(0.5, 0.5, 0.5))); var bo...

来源: Laya_示例 发布时间: 20241001

18. 鼠标脚本(JavaScript-3D基础(JS)-LayaAir3D之鼠标交互) [ 90%]

...类**: ```typescript //给四个猴子添加脚本 this.staticLayaMonkey.addComponent(MouseScript); this.layaMonkey_clone1.addComponent(MouseScript); this.layaMonkey_clone2.addComponent(MouseScript); this.layaMonkey_clone3.addComponent(MouseScript); ``` 鼠标脚本的效果如图1所示: ![](img/...

来源: Laya2.0_文档 发布时间: 20210715

19. 2D物理-桥 [ 90%]

... let groundBody = new Laya.RigidBody(); groundBody.type = "static"; ground.addComponentIntance(groundBody); let chainCollider = ground.addComponent(Laya.ChainCollider); chainCollider.points = "50,600,1050,600"; let point1 = new Laya.Sprite(); Laya.Laya.stage.addChild(point1); point1.pos(startPosX, s...

来源: Laya2.0_示例 发布时间: 20241001

20. 鼠标脚本(TypeScript-3D基础(TS)-LayaAir3D之鼠标交互) [ 90%]

...类**: ```typescript //给四个猴子添加脚本 this.staticLayaMonkey.addComponent(MouseScript); this.layaMonkey_clone1.addComponent(MouseScript); this.layaMonkey_clone2.addComponent(MouseScript); this.layaMonkey_clone3.addComponent(MouseScript); ``` 鼠标脚本的效果如图1所示: ![](img/...

来源: Laya2.0_文档 发布时间: 20210715