关于用一个 update 控制周期函数,可以做鱼阵的出现,控制渔场的暂停做冰冻渔场

@ccclass
export default class fish_manager extends cc.Component {
    
    // 。。。。。。
    private removeByuid(uid){
        let index = this.allUid.indexOf(uid);
        if (index!=-1) {
            this.allUid.splice(index,1);
            this.type.splice(index,1);
            this.time.splice(index,1);
            this.count.splice(index,1);
            this.func.splice(index,1);
        }
    }
    private removeByFunc(func){
        for (let i = this.func.length-1; i >=0; i--) {
            if (this.func[i] == func) {
                this.time.splice(i,1);
                this.count.splice(i,1);
                this.func.splice(i,1);
                this.type.splice(i,1);
                this.allUid.splice(i,1);
            }
        }
    }
    private insert(type,time,count,func){
        this.uid++;
        this.allUid.push(this.uid);
        this.type.push(type);
        this.time.push(time);
        this.count.push(count);
        this.func.push(func);
        return this.uid;
    }
    isPause = false;
    uid:number = 0;
    dt:number = 0;
    allUid:number[] = [];
    type:(string|number)[] = [];
    time:number[] = [];
    count:number[] = [];
    func:Function[] = [];
    update(dt) {
        if (this.isPause) {
            return
        }
        this.dt+=dt;
        let index= [];
        this.time.forEach((t,i)=>{
            if (this.dt>=t && this.count[i]!=-1) {
                // time 秒一次
                this.count[i]--
                this.func[i].apply(this)
                if (this.count[i]<=0) {
                    index.push(i)
                }
            }else if (this.dt>=t &&this.count[i] == -1){
                this.func[i].apply(this)
            }
        })
        if (index.length) {
            for (let i = index.length-1; i >=0; i--) {
                const ind = index[i];
                this.time.splice(ind,1);
                this.count.splice(ind,1);
                this.func.splice(ind,1);
                this.type.splice(ind,1);
                this.allUid.splice(ind,1);
            }
        }
        if (this.dt>=Math.max(...this.time)) {
            this.dt = 0;
        }
    }
    
    // 。。。。。。
}

// 用法: this.insert(ETimerType.fishArmy,interval,repeat,creatorFish.bind(this))

思路如上,有感兴趣的大佬可以看下,会不会有啥问题呢
我的鱼阵是之前是用schedule周期性控制一个数组的,不好控制暂停什么的。

关于鱼阵大佬们是咋做的呢,一个鱼阵先完全绘制出来再移动还是一个一个的绘制,这样怎么再重连的时候知道已经出现了多少条鱼呢。