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

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

1. 下拉选项框组件 · LayaAir3.3 · 引擎文档 · LAYABOX [ 100%]

...combobox.png";//资源来自“引擎API使用示例” pageWidth: number; constructor() { super(); } // 组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次 onAwake(): void { Laya.loader.load(this.skin).then(() => { let ComboBox: Laya.ComboBox = new...

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

2. 复选框组件 · LayaAir3.3 · 引擎文档 · LAYABOX [ 99%]

...resources/res/ui/checkbox (5).png", "resources/res/ui/checkbox (6).png" ]; constructor() { super(); } /** * 组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次 */ onAwake(): void { Laya.loader.load(this.skins).then(() => { this.onCheckBoxSkinLoaded(...

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

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

... */ private _text: Laya.Text; /**盒子等级 */ private _level: number; constructor() { super(); } //组件被启用后执行 onEnable(): void { this._level = Math.round(Math.random() * 5) + 1; this._text = this.owner.getChildByName("levelTxt") as Laya.Text; this._text.text = this._level + ""; } //...

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

4. 实体组件系统 · LayaAir3.3 · 引擎文档 · LAYABOX [ 92%]

...收机制 */ @regClass() export default class Bullet extends Laya.Script { constructor() { super(); } onEnable(): void { //设置初始速度 let rig: Laya.RigidBody = this.owner.getComponent(Laya.RigidBody); rig.setVelocity({ x: 0, y: -10 }); } onTriggerEnter(other: any, self: any, contact: any): v...

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

5. 树状列表组件 · LayaAir3.3 · 引擎文档 · LAYABOX [ 92%]

... property } = Laya; @regClass() export class UI_Tree extends Laya.Script { constructor() { super(); } // 组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次 onAwake(): void { var res: any[] = ["atlas/comp/vscroll.png", "atlas/comp/vscroll$bar.png", "at...

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

6. 精灵 · LayaAir3.3 · 引擎文档 · LAYABOX [ 73%]

...Laya.Sprite; @property({ type: Laya.Sprite }) public sprite2: Laya.Sprite; constructor() { super(); } /** * 组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次 */ onAwake(): void { this.sprite2.on(Laya.Event.MOUSE_DOWN, this, this.test2);//设置监听...

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

7. vivo小游戏 · LayaAir3.3 · 引擎文档 · LAYABOX [ 69%]

... : Laya.Sprite3D; @property({ type: Laya.Scene3D }) scene3d: Laya.Scene3D; constructor() { super(); } /** * 组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次 */ onAwake(): void { //小游戏加载分包 Laya.loader.loadPackage("sub1", this.printProgr...

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

8. 插件开发说明 · LayaAir3.3 · 引擎文档 · LAYABOX [ 69%]

...egClass() export class DemoPreviewPlugin extends IEditorEnv.AssetPreview { constructor() { super(); this.sprite.graphics.drawCircle(100, 100, 50, "#ffff00"); this.sprite.size(100, 100); } async setAsset(asset: IEditorEnv.IAssetInfo): Promise<any> { this.renderTarget = this.sprite; } } 显示...

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

9. 使用3D摄像机 · LayaAir3.3 · 引擎文档 · LAYABOX [ 65%]

...: number = 20 public curpos: Laya.Vector3; private delatpos: Laya.Vector3; constructor() { super(); } /** * 组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次 * 此方法为虚方法,使用时重写覆盖即可 */ onAwake(): void { this.curpos = new...

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

10. 组件装饰器说明 · LayaAir3.3 · 引擎文档 · LAYABOX [ 55%]

...tends Laya.Script { @property({ type: Laya.Sprite3D }) sp3: Laya.Sprite3D; constructor() { super(); } onEnable() { console.log("Game onStart", this.sp3.name); } } 除非有特别的需求,我们并不建议这样做,一方面是因为静态物体更有利于IDE内进行编辑。另一方面是...

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