Exemple #1
0
        public override void addObject(IDelayHandleItem delayObject, float priority = 0.0f)
        {
            if (bInDepth())
            {
                base.addObject(delayObject, priority);
            }
            else
            {
                int position = -1;
                for (int i = 0; i < m_tickLst.Count; i++)
                {
                    if (m_tickLst[i] == null)
                    {
                        continue;
                    }

                    if (m_tickLst[i].m_tickObject == delayObject)
                    {
                        return;
                    }

                    if (m_tickLst[i].m_priority < priority)
                    {
                        position = i;
                        break;
                    }
                }

                TickProcessObject processObject = new TickProcessObject();
                processObject.m_tickObject = delayObject as ITickedObject;
                processObject.m_priority   = priority;

                if (position < 0 || position >= m_tickLst.Count)
                {
                    m_tickLst.Add(processObject);
                }
                else
                {
                    m_tickLst.Insert(position, processObject);
                }
            }
        }
Exemple #2
0
        public override void addObject(IDelayHandleItem delayObject, float priority = 0.0f)
        {
            if (bInDepth())
            {
                base.addObject(delayObject, priority);
            }
            else
            {
                int position = -1;
                for (int i = 0; i < m_tickLst.Count; i++)
                {
                    if (m_tickLst[i] == null)
                        continue;

                    if (m_tickLst[i].m_tickObject == delayObject)
                    {
                        return;
                    }

                    if (m_tickLst[i].m_priority < priority)
                    {
                        position = i;
                        break;
                    }
                }

                TickProcessObject processObject = new TickProcessObject();
                processObject.m_tickObject = delayObject as ITickedObject;
                processObject.m_priority = priority;

                if (position < 0 || position >= m_tickLst.Count)
                {
                    m_tickLst.Add(processObject);
                }
                else
                {
                    m_tickLst.Insert(position, processObject);
                }
            }
        }