2d对象池
作者:
沉麟 | 来源:发表于
2020-07-09 16:36 被阅读0次getCoinPool() {
if (this.coinPools.length <= 0) {
let coin = new Laya.Image();
coin.skin = "res/game/icon_jinbi.png";
return coin;
} else {
return this.coinPools.pop();
}
}
pushCoinPool(coin: Laya.Image) {
this.coinPools.push(coin);
}
getLinePool() {
if (this.linePools.length <= 0) {
let coinAni = this.coinLineAni.clone();
return coinAni;
} else {
return this.linePools.pop();
}
}
pushLinePool(coinAni: Laya.Animation) {
this.linePools.push(coinAni);
}
本文标题:2d对象池
本文链接:https://www.haomeiwen.com/subject/tcescktx.html
网友评论