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

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

1. 程序蓝图 · LayaAir3.0文档 · LAYABOX [ 100%]

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

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

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

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

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

3. 多线程Worker · LayaAir3.0文档 · LAYABOX [ 90%]

...方便显示,我们新建一个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_文档 发布时间: 20240528

4. 二次开发 · LayaAir3.0文档 · LAYABOX [ 81%]

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

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

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

组件装饰器说明一、@regClass()二、@property()2.1 组件属性的常规使用2.2 属性访问器的装饰器使用2.3 是否序列化保存2.4 组件属性是否在IDE中显示2.5 装饰器属性标识的类型2.6 组件属性值的输入控件2.7 组件属性分类与排序2.8 装饰器...

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

6. 实体组件系统 · 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

7. 动画状态机详解 · LayaAir3.0文档 · 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_文档 发布时间: 20230804

8. 使用3D精灵 · LayaAir3.0文档 · LAYABOX [ 55%]

...机添加了这个脚本。 (图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_文档 发布时间: 20240624

9. 和原生Dom交互 · LayaAir3.0文档 · LAYABOX [ 54%]

...载到自己的项目中或者服务器中。 下面是主类的逻辑: class LayaUISample { constructor() { //初始化引擎 Laya.init(0,0); var Hls:any = Laya.Browser.window.Hls;//获取对Hls的引用。 var plyr:any = Laya.Browser.window.plyr;//获取对plyr的引用 //获取video对象,就...

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

10. 精灵 · LayaAir3.0文档 · LAYABOX [ 39%]

...下添加一个自定义组件脚本,并添加如下代码: 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_文档 发布时间: 20240528