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

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

1. UI运行时 · LayaAir3.3 · 引擎文档 · LAYABOX [ 100%]

...脚本,而后添加的代码如下所示: const { regClass } = Laya; import { RuntimeScriptBase } from "./RuntimeScript.generated"; @regClass() export class RuntimeScript extends RuntimeScriptBase { onAwake(): void { // Button添加鼠标事件,让Image不显示 this.Button.on( Laya.Event.MOUS...

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

2. 使用3D UI · LayaAir3.3 · 引擎文档 · LAYABOX [ 81%]

...添加Runtime类,添加逻辑代码如下: const { regClass } = Laya; import { BloodBarBase } from "./BloodBar.generated"; import { Main } from "./Main"; @regClass() export class BloodBar extends BloodBarBase { onAwake(): void { this.bar.value = 1; this.value.visible = false; Laya.stage.on(Laya....

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

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

...p,glob,pinyin, @svgdotjs/svg.js等。引用node内置模块可以使用import xx from "xx"的方式,所有IDE内置cjs模块都可以通过IEditor.require或者IEditorEnv.require去引用。 //可以通过import导入node内置模块 import fs from "fs"; import path from "path"; //也可以通...

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

4. 基础使用与构成 · LayaAir3.3 · 引擎文档 · LAYABOX [ 68%]

...调整,使其满足列表渲染所需的格式。 示例代码如下: import { ItemBoxBase } from "./ItemBox.generated"; const { regClass, property } = Laya; @regClass() export class Script extends ItemBoxBase { constructor() { super(); } get dataSource(): any { return super.dataSource; } set da...

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

5. 弹窗视图组件 · LayaAir3.3 · 引擎文档 · LAYABOX [ 66%]

...,在RuntimeScript.ts中添加如下代码: const { regClass } = Laya; import { RuntimeScriptBase } from "./RuntimeScript.generated"; @regClass() export class RuntimeScript extends RuntimeScriptBase { onAwake(): void { this.closeBtn.on(Laya.Event.CLICK, this, () => { this.close(); }); } } 1.3....

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

6. 场景管理 · LayaAir3.3 · 引擎文档 · LAYABOX [ 49%]

...本 "点击成功!",代码如下所示: const { regClass } = Laya; import { MsgRTBase } from "./MsgRT.generated"; @regClass() export class MsgRT extends MsgRTBase { onOpened(param: any): void { console.log(param.text); } } 这样,点击Scene场景中的Button,就会打印日志“点击成...

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

7. 预制体 · LayaAir3.3 · 引擎文档 · LAYABOX [ 48%]

...码中,可以看到,通过预加载一组预制体的实现代码: import { LoadingRTBase } from "./LoadingRT.generated"; const { regClass, property } = Laya; @regClass() export default class LoadingRT extends LoadingRTBase { onAwake(): void { Laya.loader.load( //先加载本场景要用的 ["...

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

8. 预制体模块 · LayaAir3文档 · LAYABOX [ 47%]

...码中,可以看到,通过预加载一组预制体的实现代码: import { LoadingRTBase } from "./LoadingRT.generated"; const { regClass, property } = Laya; @regClass() export default class LoadingRT extends LoadingRTBase { onAwake(): void { Laya.loader.load( //先加载本场景要用的 ["...

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

9. 屏幕适配 · LayaAir3.3 · 引擎文档 · LAYABOX [ 32%]

...ge.designWidth和Laya.stage.designHeight来设置。 示例代码如下: import { IndexRTBase } from "./IndexRT.generated"; const { regClass } = Laya; @regClass() export default class IndexRT extends IndexRTBase { onAwake(): void { //设置舞台设计宽高 Laya.stage.designWidth = 1080; Laya.sta...

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

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

...法的使用,示例代码如下: const { regClass, property } = Laya; import PhysicsGameMainRT from "../scence/physicsDemo/PhysicsGameMainRT"; /** * 掉落盒子脚本,实现盒子碰撞及回收流程 */ @regClass() export default class DropBox extends Laya.Script { /**盒子爆炸动画的...

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