예제 #1
0
 public Running(AccountUC accountform)
 {
     account           = accountform;
     m_Openning        = null;
     m_Leaving         = null;
     m_Getting         = null;
     m_CurrentPetIndex = 0;
 }
예제 #2
0
 public Running()
 {
     m_Openning        = null;
     m_Leaving         = null;
     m_Getting         = null;
     OnSafe            = false;
     m_CurrentPetIndex = 0;
 }
예제 #3
0
        public void GettingFoodFromSafe()
        {
            if (m_Getting == null)
            {
                m_Getting = new Getting(account);
            }

            m_Getting.Init();
        }
예제 #4
0
파일: Pool.cs 프로젝트: GF47/GRT
        /// <summary>
        /// 从池中获取一个实例
        /// </summary>
        /// <param name="callback">获取实例时对其进行必要的处理</param>
        public T Get(Action <T> callback = null)
        {
            T item;

            if (_queue.Count == 0)
            {
                item = _createNewFunc();
                callback?.Invoke(item);
                Getting?.Invoke(item);
                return(item);
            }
            item = _queue.Dequeue();
            callback?.Invoke(item);
            Getting?.Invoke(item);
            return(item);
        }