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

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

1. 3D变换 · LayaAir3.3 · 引擎文档 · 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_文档 发布时间: 20251010

2. 程序蓝图 · LayaAir3.3 · 引擎文档 · LAYABOX [ 99%]

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

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

3. 列表组件 · LayaAir3.3 · 引擎文档 · LAYABOX [ 96%]

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

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

4. 音频节点 · LayaAir3.3 · 引擎文档 · LAYABOX [ 94%]

...下面给出一个示例代码,实现脚本控制SoundNode: const { regClass, property } = Laya; @regClass() export class NewScript extends Laya.Script { //declare owner : Laya.Sprite3D; @property({ type: Laya.SoundNode }) public sound: Laya.SoundNode; constructor() { super(); } /** * 组件被...

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

5. 图像组件 · LayaAir3.3 · 引擎文档 · LAYABOX [ 90%]

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

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

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

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

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

7. 多行输入文本组件 · LayaAir3.3 · 引擎文档 · LAYABOX [ 86%]

...示。 (动图1-3) (动图1-4) 1.3 脚本控制TextArea const { regClass, property } = Laya; @regClass() export class TextAreaControl extends Laya.Script { //declare owner : Laya.Sprite3D; @property( { type : Laya.TextArea } ) public txtarea: Laya.TextArea; constructor() { super(); } /** * ...

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

8. 基础使用与构成 · LayaAir3.3 · 引擎文档 · LAYABOX [ 82%]

...码如下: import { ItemBoxBase } from "./ItemBox.generated"; const { regClass, property } = Laya; @regClass() export class Script extends ItemBoxBase { constructor() { super(); } get dataSource(): any { return super.dataSource; } set dataSource(value: any) { super.dataSource = value; if (!value) ...

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

9. 基础文本 · LayaAir3.3 · 引擎文档 · LAYABOX [ 82%]

...结合1.3节的脚本控制,在脚本中输入如下代码: const { regClass, property } = Laya; @regClass() export class NewScript extends Laya.Script { //declare owner : Laya.Sprite3D; @property({ type: Laya.Text }) txt: Laya.Text; constructor() { super(); } onAwake(): void { this.txt.text = "...

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

10. 显示文本组件 · LayaAir3.3 · 引擎文档 · LAYABOX [ 76%]

...。下面给出一个示例代码,实现脚本控制Label: const { regClass, property } = Laya; @regClass() export class LabelControl extends Laya.Script { //declare owner : Laya.Sprite3D; @property( { type : Laya.Label } ) public lab: Laya.Label; constructor() { super(); } /** * 组件被激活...

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