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

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

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

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

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

2. 网络通信 · LayaAir3文档 · LAYABOX [ 95%]

...备发送请求的功能。我们写个简单的例子来看下用法: class LayaSample { constructor() { //创建HttpRequest对象 let http: Laya.HttpRequest = new Laya.HttpRequest(); //设置超时时间 http.http.timeout = 10000; //发送了一个简单的请求 http.send("resources/data.txt", ...

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

3. HTTP通信 · LayaAir3.3 · 引擎文档 · LAYABOX [ 90%]

...port Event = Laya.Event; import HttpRequest = Laya.HttpRequest; const { regClass } = Laya; @regClass() export class Network_GET extends Laya.Script { private hr: HttpRequest; private logger: Laya.TextArea; private text: Laya.Label = new Laya.Label(); onAwake(): void { this.initUI(); this.connect(); ...

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

4. Windows扩展 · LayaAir3.3 · 引擎文档 · LAYABOX [ 90%]

...Main.ts中添加代码: import { testLib } from "./TestLib"; const { regClass, property } = Laya; @regClass() export class Main extends Laya.Script { onStart() { alert(testLib.nativeAdd(10, 11)); } } 因为LayaNative的扩展功能只支持Windows平台,所以只能通过Windows预览或发布...

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

5. 多线程Worker · LayaAir3.3 · 引擎文档 · LAYABOX [ 89%]

...方便显示,我们新建一个ui项目。简单的调用接口如下: class LayaUISample { constructor() { //初始化引擎 Laya.init(600,400,Laya.WebGL); //设置Laya提供的worker.js路径 Laya.WorkerLoader.workerPath = "libs/worker.js"; //开启worker线程 Laya.WorkerLoader.enable = true;...

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

6. 二次开发 · LayaAir3.3 · 引擎文档 · LAYABOX [ 78%]

...var bridge; var obj = {} as any; if (os == "Conch-ios") { bridge = PlatformClass.createClass("JSBridge");//创建脚步代理 } else if (os == "Conch-android") { //需要完整的类路径,注意与iOS的不同 bridge = PlatformClass.createClass("demo.JSBridge");//创建脚步代理 } if (os == "C...

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

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

...码如下: 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

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

组件装饰器标识的详细说明1、识别组件脚本 @regClass()1.1 代码中如何使用 @regClass()1.2 IDE中如何找到被识别的组件脚本2、识别组件 @property()2.1 组件属性的常规使用2.2 访问器的装饰器使用2.3 是否序列化保存 serializable2.4 是否为私...

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

9. Steam扩展实例 · LayaAir3.3 · 引擎文档 · LAYABOX [ 58%]

...时,完成初始化。 import { extendLib } from "./extlib"; const { regClass, property } = Laya; @regClass() export class NewScript extends Laya.Script { @property({type: Laya.Button}) public initBtn: Laya.Button; onEnable(): void { this.initBtn.on(Laya.Event.CLICK, this.onInit); } onInit() { ale...

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

10. 动画状态机 · LayaAir3.3 · 引擎文档 · LAYABOX [ 56%]

...,添加的代码如下: ... import Vector3 = Laya.Vector3; ... export class AnimationScript extends Laya.AnimatorStateScript { ... private model: Laya.Sprite3D; /**@internal */ setPlayScriptInfo(animator: Laya.Animator | Laya.Animator2D, layerindex: number, playstate: Laya.AnimatorState | Laya.A...

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