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

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

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

...t中使用本地能力 下面是一个推荐做法: //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!! @IEdito...

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

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

...ay, caller, method, args, coverBefore); } 使用示例如下: const { regClass } = Laya; import { RuntimeScriptBase } from "./RuntimeScript.generated"; @regClass() export class RuntimeScript extends RuntimeScriptBase { onAwake(): void { //60帧后,图片的透明度变为0.5 Laya.timer.frameOnce...

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

3. 视频节点 · LayaAir3.0文档 · LAYABOX [ 87%]

...下面给出一个示例代码,实现脚本控制VideoNode: const { regClass, property } = Laya; @regClass() export class NewScript extends Laya.Script { @property({ type: Laya.VideoNode }) public video: Laya.VideoNode; constructor() { super(); } // 组件被激活后执行,此时所有节点...

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

4. UI滤镜效果 · LayaAir3.0文档 · LAYABOX [ 86%]

...使用ColorFilter类直接创建滤镜,示例代码如下: const { regClass, property } = Laya; @regClass() export class NewScript extends Laya.Script { // 获得Image组件 @property({ type: Laya.Image }) public img: Laya.Image; //组件被激活后执行,此时所有节点和组件均已创...

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

5. 程序蓝图 · LayaAir3.0文档 · LAYABOX [ 85%]

...编辑器中。 3.1 类 需要在类定义之前使用装饰器的标识@bpClass,示例代码如下所示: const { bpClass } = BP; @bpClass({ name:"TestBluePrint", canInherited: true, extends:"Script" }) export class TestBluePrint extends Laya.Script { } 需要注意的是,只有注册了构...

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

6. 命令行发布 · LayaAir3.0文档 · LAYABOX [ 82%]

...台脚本执行结束后,后台进程会自动退出。 @IEditorEnv.regClass() class MyScript { static async buildWeb() { return IEditorEnv.BuildTask.start("web").waitForCompletion(); } } (图2-1) 下面给出各平台的发布脚本, @IEditorEnv.regClass() class MyScript { // 构建web stat...

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

7. 3D变换 · LayaAir3.0文档 · LAYABOX [ 82%]

...x、y和z方向上分别移动距离1,示例代码如下: 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); cons...

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

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

组件装饰器说明一、@regClass()二、@property()2.1 组件属性的常规使用2.2 属性访问器的装饰器使用2.3 是否序列化保存2.4 组件属性是否在IDE中显示2.5 装饰器属性标识的类型2.6 组件属性值的输入控件2.7 组件属性分类与排序2.8 装饰器...

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

9. 列表组件 · LayaAir3.0文档 · LAYABOX [ 80%]

...数据源 必须要在代码中给List组件设置数据源。 const { regClass, property } = Laya; @regClass() export class Script extends Laya.Script { @property({ type: Laya.List }) list: Laya.List constructor() { super(); } // 组件被启用后执行,例如节点被添加到舞台后 onEnable...

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

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

...一个示例代码,实现脚本控制OpenDataContextView: 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