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

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

1. 字体切片组件 · LayaAir3.3 · 引擎文档 · LAYABOX [ 100%]

...虎兔龙蛇马羊猴鸡狗猪年快乐"; testFontClip.spaceY = 10; this.owner.addChild(clipnum); this.owner.addChild(fontClip); this.owner.addChild(testFontClip); this.owner.addChild(testClipNum); this.owner.addChild(clipnum1); } } 通常FontClip已经可以满足开发者的基本需求。如果...

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

2. 组件脚本的内置方法 · LayaAir3.3 · 引擎文档 · LAYABOX [ 97%]

... void { this._level = Math.round(Math.random() * 5) + 1; this._text = this.owner.getChildByName("levelTxt") as Laya.Text; this._text.text = this._level + ""; } //每帧更新时执行 onUpdate(): void { //让持续盒子旋转 (this.owner as Laya.Sprite).rotation++; } //开始碰撞时执行 onTrigg...

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

3. UI运行时 · LayaAir3.3 · 引擎文档 · LAYABOX [ 89%]

... RuntimeScript; onStart() { // 获得场景的Runtime对象 this.ui = this.owner.scene as RuntimeScript; // Button添加鼠标事件,让Image不显示 this.ui.Button.on( Laya.Event.MOUSE_DOWN, null, ()=>{ this.ui.Image.visible = false; }); } } ui 属性直接从脚本中通过 this.owner.scene ...

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

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

.../Script1.ts @regClass() export class Script1 extends Laya.Script { declare owner : Laya.Sprite3D; } //TestCustomEditor.ts @IEditorEnv.customEditor(Script1) export class TestCustomEditor extends IEditorEnv.CustomEditor { declare owner: Laya.Sprite3D; onSceneGUI(): void { IEditorEnv.Handles.drawHemiSp...

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

5. 场景管理 · LayaAir3.3 · 引擎文档 · LAYABOX [ 73%]

...= Laya; @regClass() export class NewScript extends Laya.Script { //declare owner : Laya.Sprite3D; @property({ type: Laya.Prefab }) private loadingScenePrefab: Laya.Prefab; private loadingScene: Laya.Node; constructor() { super(); } /** * 第一次执行update之前执行,只会执行一次 */ onSt...

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

6. Spine渲染器 · LayaAir3.3 · 引擎文档 · LAYABOX [ 68%]

... => { // 添加Spine渲染器组件到精灵节点上 this.spine = this.owner.addComponent(Laya.Spine2DRenderNode); this.spine.source = "girl2/mix-and-match-pro.json"; // 设置Spine动画数据源 this.spine.skinName = "full-skins/girl"; // 设置皮肤名称 this.spine.play("idle", false); // ...

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

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

...vent.MOUSE_UP, this, this.mouseUp); this.camera = (<Laya.Camera>this.owner); } /** * 监听键盘事件 */ onUpdate(): void { var elapsedTime: number = Laya.timer.delta; if (!isNaN(this.lastMouseX) && !isNaN(this.lastMouseY) && this.isMouseDown) { Laya.InputManager.hasKeyDown(8...

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

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

...建完毕,此方法只执行一次 onAwake(): void { let sprite = this.owner as Laya.Sprite; //sprite.cache = true; this._temp = new Laya.Sprite(); this.owner.scene.addChild(this._temp); this.findCompents(this._allAgent, sprite.scene, Nav2DAgent); } onMouseClick(evt: Laya.Event): void { let pos = ...

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

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

...eMeshSpriteRender() { let mesh = Laya.PrimitiveMesh.createSphere(0.5); let ownerSprite = this.owner; let positionRanvge = 30; for (var i = 0; i < this._spriteNums; i++) { let sprite = ownerSprite.addChild(new Laya.Sprite3D()); let filter = sprite.addComponent(Laya.MeshFilter); let render = sprite...

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

10. 使用3D摄像机 · LayaAir3.3 · 引擎文档 · LAYABOX [ 57%]

...法,使用时重写覆盖即可 */ onStart(): void { this.camera = this.owner as Laya.Camera; if (this.target) { this.target.transform.position.cloneTo(this.curpos); this.delatpos = new Laya.Vector3(); } } /** * 每帧更新时执行,尽量不要在这里写大循环逻辑或者使用getComponen...

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