Exemplo n.º 1
0
 public void Dispose()
 {
     if (_pump != null)
     {
         _pump.Remove(this);
     }
     _pump     = null;
     _callback = null;
     _handle   = null;
     _pool.Release(this);
 }
 public void Dispose()
 {
     if (_pump != null)
     {
         _pump.Remove(this);
     }
     _pump     = null;
     _callback = null;
     if (_handle is IPooledYieldInstruction)
     {
         (_handle as IPooledYieldInstruction).Dispose();
     }
     _handle = null;
     _pool.Release(this);
 }
Exemplo n.º 3
0
        public static InvokeHandle Begin(UpdatePump pump, System.Action callback, float duration, ITimeSupplier time)
        {
            if (pump == null)
            {
                throw new System.ArgumentNullException("pump");
            }

            var handle = _pool.GetInstance();

            handle._callback = callback;
            handle._handle   = WaitForDuration.Seconds(duration, time);
            handle._pump     = pump;

            pump.Add(handle);

            return(handle);
        }
Exemplo n.º 4
0
        public static InvokeHandle Begin(UpdatePump pump, System.Action callback, System.Collections.IEnumerator e)
        {
            if (pump == null)
            {
                throw new System.ArgumentNullException("pump");
            }

            var handle = _pool.GetInstance();

            handle._callback = callback;
            handle._handle   = e;
            handle._pump     = pump;

            pump.Add(handle);

            return(handle);
        }