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

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

1031. 组件脚本的内置方法 · LayaAir3.4 · 引擎文档 · LAYABOX [ 22%]

...些初始化的操作,如获取组件引用、设置初始状态等。onDestroy方法在游戏对象被销毁时调用,可在此方法中释放游戏对象所占用的资源,如内存、纹理等,以避免内存泄漏和资源浪费。通过合理利用这些生命周期方法,开发者能...

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

1032. 2D性能优化 · LayaAir3.4 · 引擎文档 · LAYABOX [ 22%]

...ar sp:Laya.Sprite = new Laya.Sprite(); //将sp内部引用设置为null sp.destroy(); 当对象设置为null,不会立即将其从内存中删除。只有系统认为内存足够低时,垃圾回收器才会运行。内存分配(而不是对象删除)会触发垃圾回收。 垃圾回收期...

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

1033. [LayaAirIDE3]xcode切入切出声音不播放 [ 22%]

...      this.fadeIntervals.set(channel, interval);     }      public destroy(): void {         this.stopBGM();         this.stopAllEffects();         this.clearAllFades();     }      private cleanupEffectChannel(type: SoundType, url: string): void {         let oldChannel:...

来源: Laya_社区 发布时间: 20250930

1034. 微信小游戏加载资源问题 [ 18%]

...his.readyUrl]; if (ad) { ad.src = ""; if (ad._sound) { ad._sound.destroy(); ad._sound = null; ad = null; } delete MiniSound._audioCache[this.readyUrl]; } if (this._sound) { this._sound.destroy(); this._sound = null; this.readyUrl = this.url = null; } } } MiniSound._id = 0; MiniSound._audio...

来源: Laya_社区 发布时间: 20200103