Пример #1
0
        private void CallUpdateMethodByType(int time, int methodType)
        {
            switch (methodType)
            {
            case TICKS_FIXED_UPDATE:
                if (mItem.IsFixedUpdate)
                {
                    mFixedUpdateCountTime -= time;
                    if (mFixedUpdateCountTime <= 0)
                    {
                        mItem.OnFixedUpdate(mFixedUpdateDeltaTime);
                        mFixedUpdateCountTime += mFixedUpdateDeltaTime;
                    }
                }
                break;

            case TICKS_UPDATE:
                if (mItem.IsUpdate)
                {
                    mTicksLater?.Update(time);
                    mItem?.OnUpdate(time);
                }
                break;

            case TICKS_LATE_UPDATE:
                if (mItem.IsLateUpdate)
                {
                    mItem.OnLateUpdate();
                }
                break;
            }
        }
Пример #2
0
        public void FixedUpdate(int time)
        {
            if (IsDisposed)
            {
                return;
            }

            int max = mCacher.Count;

            for (int i = 0; i < max; i++)
            {
                mItem = mCacher[i];
                if (mItem.IsFixedUpdate)
                {
                    mItem.OnFixedUpdate(time);
                }
            }
            mItem = default;
        }