Beispiel #1
0
        public override void Work()
        {
            if (!IsIdle())
            {
                stopWatch.Reset();
                stopWatch.Start();
                int count = IterationCount;

                // If processAllPending is set, process as many are in the queue right now.
                // We get the count (and multiply by two for slow gen) in case bad events add more items to the queue.
                if (processAllPending)
                {
                    count = umaDirtyList.Count;
                    if (!fastGeneration)
                    {
                        count *= 2;
                    }
                }

                for (int i = 0; i < count; i++)
                {
                    OnDirtyUpdate();
                    if (IsIdle())
                    {
                        break;
                    }
                }
                ElapsedTicks += stopWatch.ElapsedTicks;
#if UNITY_EDITOR
                UnityEditor.EditorUtility.SetDirty(this);
#endif
                stopWatch.Stop();
                UMATime.ReportTimeSpendtThisFrameTicks(stopWatch.ElapsedTicks);
            }
        }
        public override void Work()
        {
            if (!IsIdle())
            {
                stopWatch.Reset();
                stopWatch.Start();
                OnDirtyUpdate();
                ElapsedTicks += stopWatch.ElapsedTicks;
#if UNITY_EDITOR
                UnityEditor.EditorUtility.SetDirty(this);
#endif
                stopWatch.Stop();
                UMATime.ReportTimeSpendtThisFrameTicks(stopWatch.ElapsedTicks);
            }
        }
 void Update()
 {
     stopWatch.Reset();
     stopWatch.Start();
     if (forceGarbageCollect > garbageCollectionRate)
     {
         GC.Collect();
         forceGarbageCollect = 0;
         if (garbageCollectionRate < 1)
         {
             garbageCollectionRate = 1;
         }
     }
     else if (umaDirtyList.Count > 0)
     {
         OnDirtyUpdate();
     }
     stopWatch.Stop();
     UMATime.ReportTimeSpendtThisFrameTicks(stopWatch.ElapsedTicks);
 }
Beispiel #4
0
        public override void Work()
        {
            if (!IsIdle())
            {
                stopWatch.Reset();
                stopWatch.Start();
                for (int i = 0; i < IterationCount; i++)
                {
                    OnDirtyUpdate();
                    if (IsIdle())
                    {
                        break;
                    }
                }
                ElapsedTicks += stopWatch.ElapsedTicks;
#if UNITY_EDITOR
                UnityEditor.EditorUtility.SetDirty(this);
#endif
                stopWatch.Stop();
                UMATime.ReportTimeSpendtThisFrameTicks(stopWatch.ElapsedTicks);
            }
        }