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

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

1. 程序蓝图 · LayaAir3.3 · 引擎文档 · 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_文档 发布时间: 20251010

2. 后期处理 · LayaAir3.3 · 引擎文档 · LAYABOX [ 92%]

...: const { regClass, property } = Laya; @regClass() export class Script extends Laya.Script { //获取节点 @property(Laya.Sprite) public sp: Laya.Sprite; onAwake(): void { //创建后期处理实例 this.sp.postProcess = new Laya.PostProcess2D(); //创建变色效果 let colorEffect2D = new Laya....

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

3. 滤镜效果 · LayaAir3.3 · 引擎文档 · LAYABOX [ 89%]

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

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

4. 3D变换 · LayaAir3.3 · 引擎文档 · LAYABOX [ 84%]

... 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_文档 发布时间: 20251010

5. 列表组件 · LayaAir3.3 · 引擎文档 · 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_文档 发布时间: 20251010

6. 视频节点 · LayaAir3.3 · 引擎文档 · LAYABOX [ 83%]

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

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

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

... 下面是一个推荐做法: //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_文档 发布时间: 20251010

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

...如下所示: const { regClass } = Laya; @regClass() export class Script extends Laya.Script { } 1.2 IDE中如何找到被识别的组件脚本 只有使用了@regClass()装饰器标识,才会被LayaAir3-IDE识别为自定义组件脚本,可以被节点(实体)所添加, 添加组件的...

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

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

...} from "./RuntimeScript.generated"; @regClass() export class RuntimeScript extends RuntimeScriptBase { onAwake(): void { // Button添加鼠标事件,让Image不显示 this.Button.on( Laya.Event.MOUSE_DOWN, this, ()=>{ this.Image.visible = false; }); } } 其次,可以在Scene2D节点下添加...

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

10. 资源加载 · LayaAir3.3 · 引擎文档 · LAYABOX [ 80%]

... const { regClass, property } = Laya; @regClass() export class LoaderDemo extends Laya.Script { onAwake(): void { this.loadTexture("resources/image/monkey2.png", 500);//需要在resources/image放入相应的资源 this.loadTexture("https://layaair.com/3.x/demo/resources/res/apes/monkey2.png"); } /*...

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