Example #1
0
    void HandleSpawnElapsed(float nowCount)
    {
        T obj = pool.GetOne();

        borns.Add(obj);
        CountTimer putBackTimer = new CountTimer(10, 1);

        ptTimers.Add(putBackTimer);
        putBackTimer.Elapsed += delegate {
            pool.PutBack(obj);
            ptTimers.Remove(putBackTimer);
            borns.Remove(obj);
        };
        putBackTimer.Start();
    }