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

大约有 103 项符合查询结果, 库内数据总量为 31,671 项。 (搜索耗时: 0.0038 秒)

21. 子弹添加了colliderShape后onUpdate移动,destroy会报错“Cannot read property 'getWorldTransform' of null” [ 72%]

...create(this, function (m) { let bullet = new Laya.MeshSprite3D(m); this.Sn.addChild(bullet); bullet.addComponent(BulletScript); var bulletCollider = bullet.addComponent(Laya.PhysicsCollider); var bulletShape = new Laya.MeshColliderShape(); bulletShape.mesh = bullet.meshFilter.sharedMesh; bulletColli...

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

22. [LayaAir3]LayaAir3.3使用Fairygui开发UI,滤镜效果对不上 [ 72%]

...ew = pkgs[0].createObject("View"); console.log(view); this.owner.addChild(view.displayObject); }); } 我提出的問題是,Fairygui編輯器和Laya編輯器,使用BlendMode和濾鏡的效果不相同。 格局豬 - 趙唐豬豬 • 2025-09-08 12:29 我重新描述問題 需求: 面板...

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

23. TiledMap地图 · LayaAir3.3 · 引擎文档 · LAYABOX [ 71%]

... private onLoaded(): void { this.tMap.mapSprite().removeSelf(); this.owner.addChild(this.tMap.mapSprite()); } //地图加载完成的回调 private completeHandler(e: any = null): void { this.onLoaded(); } } 编译运行代码,效果如图3-3所示,说明地图已创建成功。 (图3-3) 3.3...

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

24. Laya多点触控是有开关吗 为什么多点触控没有任何反应 [ 71%]

...e(){         //创建场景         let scene = Laya.stage.addChild(new Laya.Scene3D());         //创建相机         let camera = scene.addChild(new Laya.Camera(0, 0.1, 100));         //设置相机的名称         camera.name = "camera";     ...

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

25. 用raycast选取实体,hitresult始终是false [ 71%]

...lt:", outHitResult); var lineSprite: Laya.PixelLineSprite3D = this.myScene.addChild(new Laya.PixelLineSprite3D(5)) as Laya.PixelLineSprite3D; lineSprite.addLine(ray.origin, ray.direction, Laya.Color.BLUE, Laya.Color.RED); this.lineSprite.addChild(lineSprite); if (outHitResult.succeeded) { //删除...

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

26. 音频节点 · LayaAir3.3 · 引擎文档 · LAYABOX [ 71%]

...(): void { let sound = new Laya.SoundNode(); // 添加到舞台 Laya.stage.addChild(sound); sound.source = "resources/sound.wav"; //音频路径 sound.loop = 0; //循环次数设置,要放在autoPlay参数设置前 sound.autoPlay = true; //自动播放 sound.isMusic = false; //是否为背景音...

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

27. 组件脚本的内置方法 · LayaAir3.3 · 引擎文档 · LAYABOX [ 71%]

...a.Pool.getItemByCreateFun("effect", this.createEffect, this); owner.parent.addChild(effect);//将爆炸动画添加到父节点中 effect.pos(owner.x, owner.y);//设置爆炸动画的位置,让其跟随方块 owner.removeSelf();//删除方块自身节点对象 Laya.SoundManager.playSound("resource...

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

28. Sprite3D添加组件或脚本(JavaScript-3D基础(JS)-LayaAir3D之精灵) [ 70%]

..., this.onComplete)); } onComplete(){ //记载场景 var scene = Laya.stage.addChild(new Laya.Scene3D()); //加载相机 var camera = scene.addChild(new Laya.Camera(0, 0.1, 100)); camera.transform.translate(new Laya.Vector3(0, 0.8, 1.5)); camera.transform.rotate(new Laya.Vector3(-15, 0, 0), true, fal...

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

29. 垂直布局容器组件 · LayaAir3.3 · 引擎文档 · LAYABOX [ 70%]

...> { this.createBtn(); this.createvbox(); // 添加VBox组件 this.owner.addChild(this.vbox); }); } // 创建Button组件 private createBtn(): void { this.btn1 = new Laya.Button(this.skins); this.btn2 = new Laya.Button(this.skins); this.btn3 = new Laya.Button(this.skins); } // 创建VBox组件 pri...

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

30. 水平布局容器组件 · LayaAir3.3 · 引擎文档 · LAYABOX [ 70%]

...> { this.createBtn(); this.createHbox(); // 添加HBox组件 this.owner.addChild(this.hbox); }); } // 创建Button组件 private createBtn(): void { this.btn1 = new Laya.Button(this.skins); this.btn2 = new Laya.Button(this.skins); this.btn3 = new Laya.Button(this.skins); } // 创建HBox组件 pri...

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