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

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

61. [LayaAir3]addComponent(Laya.Rigidbody3D); 报错 [ 60%]

...点被添加到舞台后     onEnable(): void {         let a = this.owner.getChildByName("Sprite3D") as Laya.Sprite3D;         console.log(a,typeof(a))         let aa = a.addComponent(Laya.Rigidbody3D);     }   报错 TypeError: Cannot read properties of undefined (reading &apo...

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

62. 精灵 · LayaAir3.3 · 引擎文档 · LAYABOX [ 60%]

...= Laya; @regClass() export class NewScript extends Laya.Script { //declare owner : Laya.Sprite3D; @property({ type: Laya.Sprite }) public sprite1: Laya.Sprite; @property({ type: Laya.Sprite }) public sprite2: Laya.Sprite; constructor() { super(); } /** * 组件被激活后执行,此时所有节点...

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

63. 挂载物体的3D变换问题 [ 60%]

...riteTransform, avatarWorldMatrix, avatarWorldMatrix); Matrix4x4.multiply((_owner as Sprite3D)._transform.worldMatrix, avatarWorldMatrix, spriteWorldMatrix); 138*****175 • 2017-09-06 11:38 @我觉得挂空节点是可以省的吧?如果可以省,少了一层,也算是优化吧? 183*****755 ...

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

64. 2D寻路 · LayaAir3.3 · 引擎文档 · LAYABOX [ 59%]

...建完毕,此方法只执行一次 onAwake(): void { let sprite = this.owner as Laya.Sprite; //sprite.cache = true; this._temp = new Laya.Sprite(); this.owner.scene.addChild(this._temp); this.findCompents(this._allAgent, sprite.scene, Nav2DAgent); } onMouseClick(evt: Laya.Event): void { let pos = ...

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

65. 3D项目,如何判断一个3D模型是否在摄像机的范围内,有没有这方面的接口,,, [ 58%]

...其shinnedMeshRenderer直接点出属性isRender.完事 let mesh = this.owner.getChildAt(1) as Laya.SkinnedMeshSprite3D; console.log(mesh.skinnedMeshRenderer.isRender); 这是我测试时的模型和代码,实际使用根据模型的导出的层级和类型而定。附:我使用的是2.6.1...

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

66. box2d 弹性异常 [ 57%]

...ther: any, self: any, contact: any): void { let rig: Laya.RigidBody = this.owner.getComponent(Laya.RigidBody) as Laya.RigidBody; let velocity = rig.linearVelocity; console.log(velocity) } 你把初始弹射改成一个球,你就会发现,这个球,他的水平速度x 小于一定值后就变...

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

67. 3D物理编辑 · LayaAir3.3 · 引擎文档 · LAYABOX [ 56%]

...his.out); //将射线碰撞到的物体设置为红色 ((this.out.collider.owner).getComponent(Laya.MeshRenderer).sharedMaterial as Laya.BlinnPhongMaterial).albedoColor = new Laya.Color(0.0, 1.0, 0.0, 1.0); /* ……省略若干代码 */ 4.4 使用异形物理射线 常规的物理射线是用一条...

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

68. 3D中摄像机绕物体旋转该如何实现? [ 55%]

... } public transform: Transform3D; onStart(): void { this.transform = (this.owner as Laya.Sprite3D).transform; this.CurrentAngles = new Vector3(-this.transform.rotationEuler.x, this.transform.rotationEuler.y, 0); this.targetAngles = new Vector3(-this.transform.rotationEuler.x, this.transform.rotation...

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

69. 微信小游戏 · LayaAir3.3 · 引擎文档 · LAYABOX [ 55%]

... } = Laya; @regClass() export class Script extends Laya.Script { //declare owner : Laya.Sprite3D; @property({ type: Laya.Scene3D }) scene3d: Laya.Scene3D; constructor() { super(); } /** * 组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次 */ onAwake()...

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

70. 抖音小游戏 · LayaAir3.3 · 引擎文档 · LAYABOX [ 54%]

... } = Laya; @regClass() export class Script extends Laya.Script { //declare owner : Laya.Sprite3D; @property({ type: Laya.Scene3D }) scene3d: Laya.Scene3D; constructor() { super(); } /** * 组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次 */ onAwake()...

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