大约有 175 项符合查询结果, 库内数据总量为 31,560 项。 (搜索耗时: 0.0040 秒)
...2.0 bug onEnable 分离模式节点没有创建 脚本组件继承于 Laya.Script。 其中的_update方法,多长时间会调用一次? 可以设置调用时间吗? Laya 2.7.0beta Scene与脚本的onAwake()与onEnable()调用时机存在问题 问题状态 最新活动: 2019-07-01 08:52 浏...
来源: Laya_社区 发布时间: 20190701
...数据源。 const { regClass, property } = Laya; @regClass() export class Script extends Laya.Script { @property({ type: Laya.List }) list: Laya.List constructor() { super(); } // 组件被启用后执行,例如节点被添加到舞台后 onEnable(): void { // 给List对象赋值 var data: Array&...
来源: Laya3.0_文档 发布时间: 20251010
...lliderShape(1,1,1); } } export default class BoxMove extends Laya.Script { constructor() { super(); } onTriggerEnter() { console.log("111"); } onTriggerStay() { console.log("111"); } onTriggerExit() { console.log("111"); } onEnable() { } onDisable() { } } //这是两个类,直接可...
来源: Laya_社区 发布时间: 20190314
...代码如下所示: const { regClass } = Laya; @regClass() export class Script extends Laya.Script { } 1.2 IDE中如何找到被识别的组件脚本 只有使用了@regClass()装饰器标识,才会被LayaAir3-IDE识别为自定义组件脚本,可以被节点(实体)所添加, 添加组...
来源: Laya3.0_文档 发布时间: 20251010
...击操作,IDE会弹窗提示创建UI组件脚本文件,默认是RuntimeScript.ts,开发者可以对其进行重命名,最后点击保存即可创建脚本。 (动图2-1) 可以看到,创建以后,除了生成RuntimeScript.ts之外,在项目工程中看到还多了一个 RuntimeScri...
来源: Laya3.0_文档 发布时间: 20251010
...Class, property } = Laya; @regClass() export class LoaderDemo extends Laya.Script { onAwake(): void { this.loadTexture("resources/image/monkey2.png", 500);//需要在resources/image放入相应的资源 this.loadTexture("https://layaair.com/3.x/demo/resources/res/apes/monkey2.png"); } /**加载并...
来源: Laya3.0_文档 发布时间: 20251010
...ndNode: const { regClass, property } = Laya; @regClass() export class NewScript extends Laya.Script { //declare owner : Laya.Sprite3D; @property({ type: Laya.SoundNode }) public sound: Laya.SoundNode; constructor() { super(); } /** * 组件被激活后执行,此时所有节点和组件均已创...
来源: Laya3.0_文档 发布时间: 20251010
...s.name); } }这个同样是null export default class game_mgr extends Laya.Script { constructor() { super(); console.log(this.owner); } } 附件 : --> 2019-09-04 添加评论 免费帖 --> 分享 微博 QZONE 微信 没有找到相关结果 已邀请: 与内容相关的链接 提交 1 个回复 177*...
来源: Laya_社区 发布时间: 20190904
...”,创建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
...物体挂在脚本的时候 比如有个脚本是: class Test extends Laya.Script3D{ } 如xxx是一个3D节点,代码里执行: let script:Test = xxx.addComponent(Test); 在web端没问题,在微信开发者工具里运行报错,已上传Demo项目 附件 : --> IdleDemo.zip 2020-03-09 ...
来源: Laya_社区 发布时间: 20200309