예제 #1
0
        public void Pause()
        {
            if (mIsPause)
            {
                return;
            }

            mLeftDelayTime = -1;
            //暂停
            if (mTimeItem != null)
            {
                mLeftDelayTime = mTimeItem.SortScore - Timer.Instance.currentScaleTime;
                mTimeItem.Cancel();
                mTimeItem = null;
            }

            mIsPause = true;

            mSource.Pause();
        }
예제 #2
0
파일: Timer.cs 프로젝트: moto2002/Hunter
        public bool Cancel(int id)
        {
            TimeItem item = TimeItem.GetTimeItemByID(id);

            if (item == null)
            {
                return(false);
            }

            item.Cancel();
            return(true);
        }
예제 #3
0
파일: Timer.cs 프로젝트: LatestMatrix/rpg1
 public static void RemoveTimer(TimeItem item)
 {
     if (_items.Remove(item))
     {
         item.Cancel();
         if (_idles.Count < MAX_IDLE)
         {
             _idles.Add(item);
         }
         else
         {
             item.Dispose();
         }
     }
 }
예제 #4
0
파일: Timer.cs 프로젝트: LatestMatrix/rpg1
    public static bool RemoveTimer(int id)
    {
        int count = _items.Count;

        for (int i = 0; i < count; i++)
        {
            TimeItem item = _items[i];
            if (item.id == id)
            {
                _items.RemoveAt(i);
                item.Cancel();
                if (_idles.Count < MAX_IDLE)
                {
                    _idles.Add(item);
                }
                else
                {
                    item.Dispose();
                }
                return(true);
            }
        }
        return(false);
    }