大约有 5 项符合查询结果, 库内数据总量为 31,560 项。 (搜索耗时: 0.0028 秒)
... @param sign 对象类型标识字符。 * @param item 对象。 */ static recover(sign: string, item: any): void { if (item[Pool.POOLSIGN]) return; item[Pool.POOLSIGN] = true; Pool.getPoolBySign(sign).push(item); } 比如在游戏的一场战斗过程中,从对象池中拿出的子弹已经结束...
来源: Laya3.0_文档 发布时间: 20251010
...system.pause(); this._isPaused = true; } } } //粒子系统对象池回收 Recover(): void { this.removeSelf(); Pool.getInstance().recover(this._filePath, this); }; //彻底销毁清理一个粒子特效对象 Clean(): void { if (this.destroyed) { return; } this.Recover(); if (this._particle &&a...
来源: Laya3.0_文档 发布时间: 20251010
...system.pause(); this._isPaused = true; } } } //粒子系统对象池回收 Recover(): void { this.removeSelf(); Pool.getInstance().recover(this._filePath, this); }; //彻底销毁清理一个粒子特效对象 Clean(): void { if (this.destroyed) { return; } this.Recover(); if (this._particle &&a...
来源: Laya3.0_文档 发布时间: 20250104
...nStateExit, () => { aniNode.removeSelf();//删除动画节点 Laya.Pool.recover("effect", aniNode);//回收动画预制体到对象池中,方便下次复用。 }); return aniNode; } //组件被禁用时执行 onDisable(): void { //盒子被移除时,回收盒子到对象池,方便下次复...
来源: Laya3.0_文档 发布时间: 20251010
...弹到对象池,方便下次复用,减少对象创建开销 Laya.Pool.recover("bullet", this.owner); } } 在游戏中,将子弹添加到舞台上时,每次添加到舞台都得有初速度,但如果将onEnable()换成onAwake(),那么这个初速度就会失效。onUpdate()是每帧执行...
来源: Laya3.0_文档 发布时间: 20251010