大约有 65 项符合查询结果, 库内数据总量为 30,934 项。 (搜索耗时: 0.0047 秒)
...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_文档 发布时间: 20250310
...编辑器中。 3.1 类 需要在类定义之前使用装饰器的标识@bpClass,示例代码如下所示: const { bpClass } = BP; @bpClass({ name:"TestBluePrint", canInherited: true, extends:"Script" }) export class TestBluePrint extends Laya.Script { } 需要注意的是,只有注册了构...
来源: Laya3.0_文档 发布时间: 20250103
...使用ColorFilter类直接创建滤镜,示例代码如下: const { regClass, property } = Laya; @regClass() export class NewScript extends Laya.Script { // 获得Image组件 @property({ type: Laya.Image }) public img: Laya.Image; //组件被激活后执行,此时所有节点和组件均已创...
来源: Laya3.0_文档 发布时间: 20240910
...建好了UI组件脚本,而后添加的代码如下所示: const { regClass } = Laya; import { RuntimeScriptBase } from "./RuntimeScript.generated"; @regClass() export class RuntimeScript extends RuntimeScriptBase { onAwake(): void { // Button添加鼠标事件,让Image不显示 this.Button.on...
来源: Laya3.0_文档 发布时间: 20250310
...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_文档 发布时间: 20240910
组件装饰器说明一、@regClass()二、@property()2.1 组件属性的常规使用2.2 属性访问器的装饰器使用2.3 是否序列化保存2.4 组件属性是否在IDE中显示2.5 装饰器属性标识的类型2.6 组件属性值的输入控件2.7 组件属性分类与排序2.8 装饰器...
来源: Laya3.0_文档 发布时间: 20250103
...过unDestroyedScenes属性查看还未被销毁的场景列表 */ export class Scene extends Sprite { /**创建后,还未被销毁的场景列表,方便查看还未被销毁的场景列表,方便内存管理,本属性只读,请不要直接修改*/ static readonly unDestroyedScenes: Set<...
来源: Laya3.0_文档 发布时间: 20240910
...事件方法三、组件在IDE的暴露方式3.1 组件脚本的识别@regClass()3.2 组件属性的识别@property()3.3 IDE中执行生命周期方法@runInEditor3.4 @classInfo()四、代码中使用属性4.1 节点类型方式4.2 组件类型的使用4.3 Prefab类型属性实体组件系统(ECS...
来源: Laya3.0_文档 发布时间: 20250103
...可以在HBox下添加一些子节点。示例代码如下: const { regClass, property } = Laya; @regClass() export class NewScript extends Laya.Script { @property({ type: Laya.HBox }) public hbox: Laya.HBox; //组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只...
来源: Laya3.0_文档 发布时间: 20240910
...可以在VBox下添加一些子节点。示例代码如下: const { regClass, property } = Laya; @regClass() export class NewScript extends Laya.Script { @property({ type: Laya.VBox }) public vbox: Laya.VBox; //组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只...
来源: Laya3.0_文档 发布时间: 20240910