コード例 #1
0
        /** Advances all objects by a certain time (in seconds). */
        public void tick()
        {
            int numObjects = mObjects.Count;
            //int currentIndex = 0;
            int i;

            mElapsedTime += Time.deltaTime;
            if (numObjects == 0)
            {
                return;
            }

            // there is a high probability that the "advanceTime" function modifies the list
            // of animatables. we must not process new objects right now (they will be processed
            // in the next frame), and we need to clean up any empty slots in the list.

            for (i = 0; i < numObjects; ++i)
            {
                ITickable obj = mObjects[i];
                if (obj != null)
                {
                    obj.tick();
                    //++currentIndex;
                }
            }
        }
コード例 #2
0
        public static bool AddAntTick(ITickable ticker, UpdateType type = UpdateType.Update)
        {
            if (ticker == null)
            {
                return(false);
            }

            bool b = Add(ticker.tick, type);

            ticker.tick(0);
            return(b);
        }