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

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

1. 定时器 · LayaAir3.0文档 · LAYABOX [ 100%]

.... 清理定时器6. 立即执行并删除定时器定时器 定时器 Laya.Timer 是时钟管理类。它是一个单例,不要手动实例化此类,应该通过 Laya.timer 访问。 同时 Laya.Timer 表示游戏主时针,同时也是管理场景、动画、缓动等效果时钟,通过控...

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

2. 进度条组件 · LayaAir3.0文档 · LAYABOX [ 85%]

... this.loadText.text = "资源加载中……"; // 测试加载效果 Laya.timer.loop(100, this, this.changeProgress); } //这里仅模拟加载演示效果 changeProgress(): void { this.progressBar.value += 0.05; //每次进度条的改变量 if (this.progressBar.value == 1) { this.loadText.text = "...

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

3. 资源加载 · LayaAir3.0文档 · LAYABOX [ 69%]

...e(); this.owner.addChild(sp); let i: number = 0; //每秒重画一次 Laya.timer.loop(1000, this, () => { i == res.length && (i = 0); //清除sp节点的所有绘图(不含子节点) sp.graphics.clear(); //在sp节点上重绘纹理 sp.graphics.drawTexture(res[i]); i++; }); }); } } 2....

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

4. 2D性能优化 · LayaAir3.0文档 · LAYABOX [ 64%]

...量4.2 尽量减少旋转,缩放,alpha等属性的使用4.3 不要在Timer的循环里创建对象及复杂计算4.4 尽量少用autoSize与getBounds4.5 被try catch的函数执行会变得非常慢五、使用chrome的性能分析器5.1 CPU占用分析5.2 内存占用分析六、纹理压缩的...

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

5. 3D寻路 · LayaAir3.0文档 · LAYABOX [ 38%]

...通过Tween来执行角色位置改变的 //开启定时重复执行 Laya.timer.loop(40, this, this.loopfun); private loopfun(): void { //resPath,角色需要移动的每个世界坐标位置数组 if (this.resPath && this.index < this.resPathLength) { //AStar寻路位置 this._position...

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

6. 动画状态机详解 · LayaAir3.0文档 · LAYABOX [ 25%]

...态 this.animator.crossFade("Run", 0.1); //等待动画播放完成 Laya.timer.frameLoop(1,this,()=>{ //如果当前播放state已经播放完了一次 if(this.animator.getControllerLayer(0).getCurrentPlayState().normalizedTime >= 1){ //回到站立状态 this.animator.crossFade("Stand", 0.1);...

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

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

...ufferSourceNode.buffer = buffer; this.audioBufferSourceNode.start(0); Laya.timer.loop(1,this,this.drawHandler); } private drawHandler():void { Laya.stage.graphics.clear(); var dataArray:Uint8Array = new Uint8Array(this.analyser.frequencyBinCount); this.analyser.getByteFrequencyData(dataArray); var s...

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