예제 #1
0
 internal AsyncWorker(AsyncScheduler inScheduler, AsyncFlags inPriorityFlags)
 {
     m_Scheduler           = inScheduler;
     m_BackgroundQueue     = new Queue <AsyncWorkUnit>(64);
     m_MainThreadOnlyQueue = new Queue <AsyncWorkUnit>(64);
     m_PriorityFlags       = inPriorityFlags;
 }
예제 #2
0
        public Manager()
        {
            s_Instance = this;

            Fibers = new Table(this);
            #if DEVELOPMENT
            Scheduler = new AsyncScheduler(UnityEngine.Debug.Log);
            #else
            Scheduler = new AsyncScheduler(null);
            #endif // DEVELOPMENT

            m_FrameTimer  = new Stopwatch();
            m_UpdateTimer = new Stopwatch();

            Frame.ResetTime(Time.deltaTime, TimeScale);
            FrameDurationBudgetTicks = CalculateDefaultFrameBudgetTicks();
            AsyncBudgetTicksMin      = (long)(FrameDurationBudgetTicks * DEFAULT_ASYNC_PERCENTAGE_MIN);
            AsyncBudgetTicksMax      = (long)(FrameDurationBudgetTicks * DEFAULT_ASYNC_PERCENTAGE_MAX);

            m_QueuedGroupTimescale = new float[Routine.MAX_GROUPS];
            Frame.GroupTimeScale   = new float[Routine.MAX_GROUPS];
            for (int i = 0; i < Routine.MAX_GROUPS; ++i)
            {
                m_QueuedGroupTimescale[i] = Frame.GroupTimeScale[i] = 1.0f;
            }

            #if DEVELOPMENT
            #if UNITY_EDITOR
            DebugMode = true;
            #else
            DebugMode = UnityEngine.Debug.isDebugBuild;
            #endif // UNITY_EDITOR
            #else
            DebugMode = false;
            #endif // DEVELOPMENT

            HandleExceptions      = DebugMode;
            m_ForceSingleThreaded = AsyncScheduler.SupportsThreading;
        }
예제 #3
0
 internal AsyncWorkUnit(AsyncScheduler inScheduler)
 {
     m_Scheduler = inScheduler;
 }