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

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

61. 运行无法显示,GameConfig自动生成问题 [ 71%]

...也遇到了类似的问题,我先是建立了空项目,然后在src/script/目录下新建一个GameUI.ts文件后,GameConfig.ts的init()中并未添加reg()进行注册,后来发现是在scene的runtime里没有拖入这个GameUI.ts,拖入后就能自动生成了。 因此,你的问题...

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

62. 请问js怎么触发按钮的onclick事件,按教程的写,触发不知道为什么。 [ 70%]

...一个btn1.js 我在这样写的   export default class btn1 extends Laya.Script { constructor(){ alert("1"); //执行后这里触发了 super();} onEnable(){ alert("2"); //执行后这里触发了 } onclick(){ alert("3"); //执行后点击按钮这里没触发,不知道为什么 //Laya.Scene.ope...

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

63. LayaBox加载TiledMap地图和注意事项 [ 70%]

...们把左侧的菜单切换到代码模式。并在src目录中新建一个script文件夹,右键新建一个“新建模板文件”-》“新建脚本文件”。并编写如下代码。 [list=none] [*] [/*] [*] [/*] [*] [/*] [*] [/*] [*] [/*] [*] [/*] [*] [/*] [*] [/*] [*] [/*] [*] [/...

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

64. 勾选场景文件导出为json后,预制件也导出成json,但场景中引用的预制件还是原来的扩展名 [ 70%]

...的属性中用到了预制件,打开场景文件可以看到{ "type": "Script", "props": { "cloud": "@Prefab:prefab/Cloud.prefab", "runtime": "script/LoadingControl.js" }, "compId": 8 }但由于我导出了json格式,实际上是这个地址:prefab/Cloud.json所以加载的时候报找不到p...

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

65. 弹窗视图组件 · LayaAir3.4 · 引擎文档 · LAYABOX [ 70%]

...”,创建UI组件脚本。 (动图1-7) 保存场景后,在RuntimeScript.ts中添加如下代码: const { regClass } = Laya; import { RuntimeScriptBase } from "./RuntimeScript.generated"; @regClass() export class RuntimeScript extends RuntimeScriptBase { onAwake(): void { this.closeBtn.on(...

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

66. 基于Cannon.js的物理系统(ActionScript-3D基础(AS3)-LayaAir3D之物理系统) [ 70%]

...08* [Cannon.js](https://github.com/schteppe/cannon.js) :完全使用 JavaScript 编写的优秀 3D 物理引擎,包含简单的碰撞检测、各种形状的摩擦力、弹力、约束等功能。在LayaAir 2.7.0beta中,完成了对其基本功能的支持,并逐步在后续的版本中完...

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

67. 3D变换 · LayaAir3.4 · 引擎文档 · LAYABOX [ 69%]

...如下: const { regClass, property } = Laya; @regClass() export class NewScript extends Laya.Script { @property({ type: Laya.Sprite3D }) public cube: Laya.Sprite3D; // 平移距离 private translate: Laya.Vector3 = new Laya.Vector3(1, 1, 1); constructor() { super(); } /** * 组件被激活后执...

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

68. 2.0版本可用的CameraMoveScript.ts [ 68%]

2.0版本可用的CameraMoveScript.ts 引擎源码:点这里仅仅给找不到这个文件,或者使用这个文件无效果的小伙伴,还原一个2.0,跟示例里效果一样的文件:   /** * ... * @author */ export class CameraMoveScript extends Laya.Script {      /** @private ...

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

69. 进度条组件 · LayaAir3.4 · 引擎文档 · LAYABOX [ 68%]

...代码: const { regClass, property } = Laya; @regClass() export class NewScript extends Laya.Script { @property({ type: Laya.ProgressBar }) public progressBar: Laya.ProgressBar; @property({ type: Laya.Text }) public loadText: Laya.Text; //组件被激活后执行,此时所有节点和组件均...

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

70. 微信小游戏 · LayaAir3.4 · 引擎文档 · LAYABOX [ 68%]

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

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