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

大约有 68 项符合查询结果, 库内数据总量为 30,724 项。 (搜索耗时: 0.0036 秒)

1. 程序蓝图 · LayaAir3.0文档 · LAYABOX [ 100%]

...nst { bpClass } = BP; @bpClass({ name:"TestBluePrint", canInherited: true, extends:"Script" }) export class TestBluePrint extends Laya.Script { } 需要注意的是,只有注册了构造函数,才可以在蓝图编辑器的createNew中创建这个类的实例,如图12-1所示。 const { bpClas...

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

2. 定时器 · LayaAir3.0文档 · LAYABOX [ 98%]

...} from "./RuntimeScript.generated"; @regClass() export class RuntimeScript extends RuntimeScriptBase { onAwake(): void { //60帧后,图片的透明度变为0.5 Laya.timer.frameOnce(60, this, () => { this.Image.alpha = 0.5; }) } } 1.2 定时重复执行 (基于帧率) Laya.timer.frameLoop,定...

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

3. 插件开发说明 · LayaAir3.0文档 · LAYABOX [ 96%]

... 下面是一个推荐做法: //Script.ts @Laya.regClass() class Script extends Laya.Script { wantToUseNode() { EditorEnv.scene.runScript("TestSceneScript.visitNode"); } } //TestSceneScript.ts import fs from "fs"; //注意是IEditorEnv.regClass,不是Laya.regClass!! @IEditorEnv.regClass() class ...

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

4. 视频节点 · LayaAir3.0文档 · LAYABOX [ 91%]

... const { regClass, property } = Laya; @regClass() export class NewScript extends Laya.Script { @property({ type: Laya.VideoNode }) public video: Laya.VideoNode; constructor() { super(); } // 组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次 onAwake()...

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

5. UI滤镜效果 · LayaAir3.0文档 · LAYABOX [ 91%]

... const { regClass, property } = Laya; @regClass() export class NewScript extends Laya.Script { // 获得Image组件 @property({ type: Laya.Image }) public img: Laya.Image; //组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次 onAwake(): void { //创建...

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

6. 3D变换 · LayaAir3.0文档 · LAYABOX [ 86%]

... const { regClass, property } = Laya; @regClass() export class NewScript extends Laya.Script { @property({ type: Laya.Sprite3D }) public cube: Laya.Sprite3D; // 平移距离 private translate: Laya.Vector3 = new Laya.Vector3(1, 1, 1); constructor() { super(); } /** * 组件被激活后执行,此...

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

7. 列表组件 · LayaAir3.0文档 · LAYABOX [ 84%]

...。 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<any&gt...

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

8. 开放数据域组件 · LayaAir3.0文档 · LAYABOX [ 84%]

... const { regClass, property } = Laya; @regClass() export class NewScript extends Laya.Script { //declare owner : Laya.Sprite3D; @property({ type: Laya.OpenDataContextView }) public opendata: Laya.OpenDataContextView; constructor() { super(); } /** * 组件被激活后执行,此时所有节点和...

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

9. 弹窗视图组件 · LayaAir3.0文档 · LAYABOX [ 84%]

...} from "./RuntimeScript.generated"; @regClass() export class RuntimeScript extends RuntimeScriptBase { onAwake(): void { this.closeBtn.on(Laya.Event.CLICK, this, () => { this.close(); }); } } 1.3.3 关联场景 设置好弹窗之后,需要用代码将Dialog与所需要用到该Dialog的场景...

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

10. 组件装饰器说明 · LayaAir3.0文档 · LAYABOX [ 82%]

...如下所示: const { regClass } = Laya; @regClass() export class Script extends Laya.Script { } 如动图1-1所示,只有使用了上述的这个装饰器标识,开发者自定义的组件脚本才会被IDE识别为组件,可以被节点(实体)的属性设置面板 -> 增加组件 -...

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