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

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

1. 3D变换 · LayaAir3.0文档 · LAYABOX [ 100%]

...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

2. 列表组件 · LayaAir3.0文档 · LAYABOX [ 87%]

...数据源 必须要在代码中给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

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

...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

4. 对象池 · LayaAir3.0文档 · LAYABOX [ 76%]

...的类。 * @return 此类型标识的一个对象。 */ static getItemByClass<T>(sign: string, cls: new () => T): T { if (!Pool._poolDic[sign]) return new cls(); var pool = Pool.getPoolBySign(sign); if (pool.length) { var rst = pool.pop(); rst[Pool.POOLSIGN] = false; } else { rst = new cls...

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

5. 场景管理 · LayaAir3.0文档 · LAYABOX [ 73%]

...过unDestroyedScenes属性查看还未被销毁的场景列表 */ export class Scene extends Sprite { /**创建后,还未被销毁的场景列表,方便查看还未被销毁的场景列表,方便内存管理,本属性只读,请不要直接修改*/ static readonly unDestroyedScenes: Set<...

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

6. 字体切片组件 · LayaAir3.0文档 · LAYABOX [ 71%]

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

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

7. UI运行时 · LayaAir3.0文档 · LAYABOX [ 68%]

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

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

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

组件装饰器说明一、@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 [ 60%]

...以写一个Tool工具类,方便转换使用: //Tool工具类 export class Tool { private static transVertex0: Laya.Vector3 = new Laya.Vector3(); private static transVertex1: Laya.Vector3 = new Laya.Vector3(); private static transVertex2: Laya.Vector3 = new Laya.Vector3(); private static corners...

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

10. 实体组件系统 · LayaAir3.0文档 · LAYABOX [ 58%]

...事件方法三、组件在IDE的暴露方式3.1 组件脚本的识别@regClass()3.2 组件属性的识别@property()3.3 IDE中执行生命周期方法@runInEditor3.4 @classInfo()四、代码中使用属性4.1 节点类型方式4.2 组件类型的使用4.3 Prefab类型属性实体组件系统(ECS...

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