예제 #1
0
        /// <summary>
        /// 增加到工作流的尾部,moveTask用于控制当已经存在key的时候,是否将它移动到尾部
        /// </summary>
        public void AddLast(string key, CoroutineAcion coroutineAcion, bool replaceAction = true, bool moveTask = false)
        {
            if (m_CoroutineMap.ContainsKey(key))
            {
                if (replaceAction)
                {
                    m_CoroutineMap[key] = coroutineAcion;
                }

                if (moveTask)
                {
                    coroutineAcion = m_CoroutineMap[key];
                    m_CoroutineMap.Remove(key);
                    m_CoroutineMap.AddLast(key, coroutineAcion);
                }
            }
            else
            {
                m_CoroutineMap.AddLast(key, coroutineAcion);
            }
        }