Exemplo n.º 1
0
        private void BeforeStopEmitter(uint timerId, object cookie)
        {
            List <uint> list = this.beforeStopTimerIds;

            if (list != null)
            {
                int count = list.Count;
                for (int i = 0; i < count; i++)
                {
                    if (list[i] == timerId)
                    {
                        list.RemoveAt(i);
                        break;
                    }
                }
            }
            EmitterPoolCookie emitterPoolCookie = (EmitterPoolCookie)cookie;

            emitterPoolCookie.EmitterStop(emitterPoolCookie.Cookie);
            if (MathUtils.IsGreaterThanZero(emitterPoolCookie.DelayPostEmitterStop))
            {
                timerId = Service.ViewTimerManager.CreateViewTimer(emitterPoolCookie.DelayPostEmitterStop, false, new TimerDelegate(this.AfterStopEmitter), emitterPoolCookie);
                this.AddAfterStopTimerId(timerId);
            }
            else
            {
                this.AfterStopEmitter(0u, emitterPoolCookie);
            }
        }
Exemplo n.º 2
0
        private void BeforeStopEmitter(uint timerId, object cookie)
        {
            if (this.beforeStopTimerIds != null)
            {
                this.beforeStopTimerIds.Remove(timerId);
            }
            EmitterPoolCookie emitterPoolCookie = (EmitterPoolCookie)cookie;

            emitterPoolCookie.EmitterStop(emitterPoolCookie.Cookie);
            if (MathUtils.IsGreaterThanZero(emitterPoolCookie.DelayPostEmitterStop))
            {
                timerId = Service.Get <ViewTimerManager>().CreateViewTimer(emitterPoolCookie.DelayPostEmitterStop, false, new TimerDelegate(this.AfterStopEmitter), emitterPoolCookie);
                this.AddAfterStopTimerId(timerId);
                return;
            }
            this.AfterStopEmitter(0u, emitterPoolCookie);
        }