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

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

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 [ 88%]

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

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

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

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

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

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

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

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

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

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

...时,完成初始化。 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

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

...,添加的代码如下: ... 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

8. 使用3D精灵 · LayaAir3.3 · 引擎文档 · LAYABOX [ 57%]

...机添加了这个脚本。 (图6-2) 脚本的代码为: const { regClass, property } = Laya; @regClass() export class CameraMoveScript extends Laya.Script3D { /** @private */ protected _tempVector3: Laya.Vector3 = new Laya.Vector3(); protected lastMouseX: number = 0; protected lastMouseY: num...

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

9. 屏幕适配 · LayaAir3.3 · 引擎文档 · LAYABOX [ 36%]

...码如下: import { IndexRTBase } from "./IndexRT.generated"; const { regClass } = Laya; @regClass() export default class IndexRT extends IndexRTBase { onAwake(): void { //设置舞台设计宽高 Laya.stage.designWidth = 1080; Laya.stage.designHeight = 1920; //在引擎初始化之后改变舞台...

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

10. 精灵 · LayaAir3.3 · 引擎文档 · LAYABOX [ 31%]

...下添加一个自定义组件脚本,并添加如下代码: const { regClass, property } = Laya; @regClass() export class NewScript extends Laya.Script { //declare owner : Laya.Sprite3D; @property({ type: Laya.Sprite }) public sprite1: Laya.Sprite; @property({ type: Laya.Sprite }) public sprite2...

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