大约有 149 项符合查询结果, 库内数据总量为 31,722 项。 (搜索耗时: 0.0059 秒)
...也遇到了类似的问题,我先是建立了空项目,然后在src/script/目录下新建一个GameUI.ts文件后,GameConfig.ts的init()中并未添加reg()进行注册,后来发现是在scene的runtime里没有拖入这个GameUI.ts,拖入后就能自动生成了。 因此,你的问题...
来源: Laya_社区 发布时间: 20181207
...一个btn1.js 我在这样写的 export default class btn1 extends Laya.Script { constructor(){ alert("1"); //执行后这里触发了 super();} onEnable(){ alert("2"); //执行后这里触发了 } onclick(){ alert("3"); //执行后点击按钮这里没触发,不知道为什么 //Laya.Scene.ope...
来源: Laya_社区 发布时间: 20181028
...们把左侧的菜单切换到代码模式。并在src目录中新建一个script文件夹,右键新建一个“新建模板文件”-》“新建脚本文件”。并编写如下代码。 [list=none] [*] [/*] [*] [/*] [*] [/*] [*] [/*] [*] [/*] [*] [/*] [*] [/*] [*] [/*] [*] [/*] [*] [/...
来源: Laya_社区 发布时间: 20190321
...的属性中用到了预制件,打开场景文件可以看到{ "type": "Script", "props": { "cloud": "@Prefab:prefab/Cloud.prefab", "runtime": "script/LoadingControl.js" }, "compId": 8 }但由于我导出了json格式,实际上是这个地址:prefab/Cloud.json所以加载的时候报找不到p...
来源: Laya_社区 发布时间: 20181011
...”,创建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
...08* [Cannon.js](https://github.com/schteppe/cannon.js) :完全使用 JavaScript 编写的优秀 3D 物理引擎,包含简单的碰撞检测、各种形状的摩擦力、弹力、约束等功能。在LayaAir 2.7.0beta中,完成了对其基本功能的支持,并逐步在后续的版本中完...
来源: Laya2.0_文档 发布时间: 20210714
...如下: 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
2.0版本可用的CameraMoveScript.ts 引擎源码:点这里仅仅给找不到这个文件,或者使用这个文件无效果的小伙伴,还原一个2.0,跟示例里效果一样的文件: /** * ... * @author */ export class CameraMoveScript extends Laya.Script { /** @private ...
来源: Laya_社区 发布时间: 20200707
...代码: 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
...例代码: 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