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

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

1. 3D性能优化 · LayaAir3.3 · 引擎文档 · LAYABOX [ 100%]

...码如下: const { regClass, property } = Laya; @regClass() export class Script extends Laya.Script { //共享材质,用于合批 public batchMat: Laya.Material; //颜色数目 private _colorNums = 20; //精灵数目 private _spriteNums = 200; private _createColorBufferData() { //随机给20个...

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

2. 实体组件系统 · LayaAir3.3 · 引擎文档 · LAYABOX [ 91%]

...擎中,组件和系统的职责融合在组件脚本(即继承自 Laya.Script 的类)中体现: 组件部分:通过类中的属性字段或访问器承担组件的数据职责,通常使用 @property() 装饰器标记这些字段,将其暴露到IDE属性面板,方便开发者进行可...

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

3. 按钮组件 · LayaAir3.3 · 引擎文档 · LAYABOX [ 90%]

...代码: const { regClass, property } = Laya; @regClass() export class NewScript extends Laya.Script { @property({ type: Laya.Button }) public btn: Laya.Button; //组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次 onAwake(): void { this.btn.scale(5, ...

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

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

...代码如下所示: const { regClass } = Laya; @regClass() export class Script extends Laya.Script { } 1.2 IDE中如何找到被识别的组件脚本 只有使用了@regClass()装饰器标识,才会被LayaAir3-IDE识别为自定义组件脚本,可以被节点(实体)所添加, 添加组...

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

5. 2D光遮挡器与阴影 · LayaAir3.3 · 引擎文档 · LAYABOX [ 78%]

...ss, property } = Laya; @regClass() export class LightOccluder extends Laya.Script { private spotLight: Laya.Sprite = new Laya.Sprite(); private background: Laya.Sprite = new Laya.Sprite(); private lightOccluder: Laya.Sprite = new Laya.Sprite(); private backgroundTexture: string = "resources/bg2.png"...

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

6. 插件开发说明 · LayaAir3.3 · 引擎文档 · LAYABOX [ 72%]

...IDE插件开发说明一、插件能力二、插件运行环境2.1 在Laya.Script中使用本地能力2.2 UI进程脚本和Scene进程脚本通讯的方式2.3 预览运行进程和UI进程的通讯方式三、制作编辑器UI四、程序化生成界面4.1 常用方法4.2 示例五、自定义Inspec...

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

7. WebSocket通信 · LayaAir3.3 · 引擎文档 · LAYABOX [ 71%]

...t { regClass } = Laya; @regClass() export class WebSocketDemo extends Laya.Script { private socket: Laya.Socket; //组件被启用后执行,例如节点被添加到舞台后 onEnable(): void { this.socket = new Laya.Socket(); // 注册事件监听 this.socket.on(Laya.Event.OPEN, this, this.onSocke...

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

8. 精灵 · LayaAir3.3 · 引擎文档 · LAYABOX [ 66%]

...代码: 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: Laya.Sprite; constructor() { super(); } /** * 组件...

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

9. 2D寻路 · LayaAir3.3 · 引擎文档 · LAYABOX [ 56%]

...Class, property } = Laya; @regClass() export class TestSprite extends Laya.Script { // 用于显示鼠标点击的位置 @property({ type: Laya.Sprite }) public hit: Sprite; private _temp: Sprite; private _allAgent: Nav2DAgent[] = []; private findCompents(lists: any[], sprite: Sprite, componentType:...

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

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

... 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: number = 0; protected yawPitchRoll: Laya.Vector3 = new Laya.Vecto...

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