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

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

71. Steam扩展实例 · LayaAir3.4 · 引擎文档 · LAYABOX [ 70%]

...钮时,完成初始化。 import { extendLib } from "./extlib"; const { regClass, property } = Laya; @regClass() export class NewScript extends Laya.Script { @property({type: Laya.Button}) public initBtn: Laya.Button; onEnable(): void { this.initBtn.on(Laya.Event.CLICK, this.onInit); } onInit() { ...

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

72. 组件脚本的内置方法 · LayaAir3.4 · 引擎文档 · LAYABOX [ 70%]

...启用等)自动执行相应的方法。 使用示例如下: const { regClass } = Laya; @regClass() export class NewScript extends Laya.Script { //被添加到节点后调用,和Awake不同的是即使节点未激活onAdded也会调用 onAdded(): void { console.log("Game onAdded"); } //组件...

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

73. 新手入坑请教下各位大神关于LayaMaxUI问题 [ 69%]

...=Laya.Dialog; import Scene=Laya.Scene; var REG: Function = Laya.ClassUtils.regClass; export module ui.test { export class TestSceneUI extends Laya.Scene {         public scoreLbl:Laya.Label;         public tipLbll:Laya.Label; constructor(){ super()} createChildren():void { super.crea...

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

74. [LayaAir3]3.3.2与设置组件灰显相关的 Bug 和 Crash [ 69%]

...开发者自行在脚本里调用重绘API。 示例代码如下:const { regClass } = Laya; interface AnimatorPlayScriptInfo { animator: Laya.Animator2D; layerindex: number; playState: Laya.AnimatorState2D; } /** * 继承自AnimatorStateScript(动画状态脚本) */ @regClass() export class Animat...

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

75. 导航容器组件 · LayaAir3.4 · 引擎文档 · LAYABOX [ 69%]

...其暴露的属性入口中。需要添加如下的示例代码: const { regClass, property } = Laya; @regClass() export class NewScript extends Laya.Script { @property({ type: Laya.ViewStack }) public viewstack: Laya.ViewStack; @property({ type: Laya.Tab }) public tab: Laya.Tab; //组件被激活...

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

76. UI弹窗 · LayaAir3.0文档 · LAYABOX [ 68%]

... (动图8) 3、代码创建Dialog组件 代码运行结果: const { regClass, property } = Laya; @regClass() export class UI_Dialog extends Laya.Script { private DIALOG_WIDTH: number = 220; private DIALOG_HEIGHT: number = 275; private CLOSE_BTN_WIDTH: number = 43; private CLOSE_BTN_PADDING: nu...

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

77. 树状列表组件 · LayaAir3.4 · 引擎文档 · LAYABOX [ 67%]

...性入口中,在代码里给 Tree 对象赋值的示例如下: const { regClass, property } = Laya; @regClass() export class NewScript extends Laya.Script { @property({ type: Laya.Tree }) public tree: Laya.Tree; //组件被激活后执行,此时所有节点和组件均已创建完毕,此方...

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

78. HTTP通信 · LayaAir3.4 · 引擎文档 · LAYABOX [ 67%]

... import Event = Laya.Event; import HttpRequest = Laya.HttpRequest; const { regClass } = Laya; @regClass() export class Network_GET extends Laya.Script { private hr: HttpRequest; private logger: Laya.TextArea; private text: Laya.Label = new Laya.Label(); onAwake(): void { this.initUI(); this.connect(...

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

79. 动效问题,没有 ui.TestPUI,官方文档是错的,几年了至今无解答 [ 67%]

..., Laya.Handler.create(this, this.onLoaded)) onLoaded(){ // Laya.ClassUtils.regClass('ui.TestPUI', ui.TestPUI) var efc = new ui.TestPUI(); Laya.stage.addChild(efc); } 按照官方文档,运行后报错 Main.js:61 Uncaught ReferenceError: ui is not defined 之前有人提过这个问题,但是一...

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

80. [LayaAir3]Pool对象池获取继承对象时会返回基类对象 [ 67%]

[LayaAir3]Pool对象池获取继承对象时会返回基类对象 const { regClass, property } = Laya; @regClass() export class Main extends Laya.Script { onStart() { let item1 = Laya.Pool.createByClass(TestClass); console.log('item1:', item1.type); Laya.Pool.recoverByClass(item1); let item2 = Laya...

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