大约有 27 项符合查询结果, 库内数据总量为 31,560 项。 (搜索耗时: 0.0039 秒)
...击操作,IDE会弹窗提示创建UI组件脚本文件,默认是RuntimeScript.ts,开发者可以对其进行重命名,最后点击保存即可创建脚本。 (动图2-1) 可以看到,创建以后,除了生成RuntimeScript.ts之外,在项目工程中看到还多了一个 RuntimeScri...
来源: Laya3.0_文档 发布时间: 20251010
... { regClass, property } = Laya; @regClass() export class Main extends Laya.Script { onStart() { console.log("Game start"); } } 2.2 场景的脚本说明 前面讲了项目的入口, 本小节简述一下场景的脚本。场景的脚本主要是两类, 一类是自定义的组件脚本。这种...
来源: Laya3.0_文档 发布时间: 20251103
...代码如下所示: const { regClass } = Laya; @regClass() export class Script extends Laya.Script { } 1.2 IDE中如何找到被识别的组件脚本 只有使用了@regClass()装饰器标识,才会被LayaAir3-IDE识别为自定义组件脚本,可以被节点(实体)所添加, 添加组...
来源: Laya3.0_文档 发布时间: 20251010
...一、开放数据域简介 开放数据域是一个封闭、独立的 JavaScript 作用域。在设计小游戏时,为了使游戏的可玩性更强,开发者需要实现一些社交玩法,例如排行榜,游戏中邀请其它玩家对战等。这些功能需要用到一些玩家的隐私...
来源: Laya3.0_文档 发布时间: 20251010
...代码: 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
...Radio: const { regClass, property } = Laya; @regClass() export class NewScript extends Laya.Script { @property({ type: Laya.Radio }) public radio: Laya.Radio; //组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次 onAwake(): void { this.radio.skin = "...
来源: 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
...Clip: const { regClass, property } = Laya; @regClass() export class NewScript extends Laya.Script { @property({ type: Laya.Clip }) public clip: Laya.Clip; //组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次 onAwake(): void { this.clip.pos(Laya.stag...
来源: Laya3.0_文档 发布时间: 20251010
...mboBox: const { regClass, property } = Laya; @regClass() export class NewScript extends Laya.Script { @property({ type: Laya.ComboBox }) public combobox: Laya.ComboBox; //组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次 onAwake(): void { this.comb...
来源: Laya3.0_文档 发布时间: 20251010
...ass, property } = Laya; @regClass() export class LabelControl extends Laya.Script { //declare owner : Laya.Sprite3D; @property( { type : Laya.Label } ) public lab: Laya.Label; constructor() { super(); } /** * 组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执...
来源: Laya3.0_文档 发布时间: 20251010