GetThreadName() private method

private GetThreadName ( ) : string
return string
        private void CalculateBars(Rect r, int frameIndex, float time)
        {
            ProfilerFrameDataIterator profilerFrameDataIterator = new ProfilerFrameDataIterator();
            int   groupCount = profilerFrameDataIterator.GetGroupCount(frameIndex);
            float num        = 0f;

            profilerFrameDataIterator.SetRoot(frameIndex, 0);
            int threadCount = profilerFrameDataIterator.GetThreadCount(frameIndex);
            int i;

            for (i = 0; i < threadCount; i++)
            {
                profilerFrameDataIterator.SetRoot(frameIndex, i);
                string groupname = profilerFrameDataIterator.GetGroupName();
                ProfilerTimelineGUI.GroupInfo groupInfo = this.groups.Find((ProfilerTimelineGUI.GroupInfo g) => g.name == groupname);
                if (groupInfo == null)
                {
                    groupInfo          = new ProfilerTimelineGUI.GroupInfo();
                    groupInfo.name     = groupname;
                    groupInfo.height   = 20f;
                    groupInfo.expanded = false;
                    groupInfo.threads  = new List <ProfilerTimelineGUI.ThreadInfo>();
                    this.groups.Add(groupInfo);
                    if (groupname == string.Empty || groupname == "Unity Job System")
                    {
                        groupInfo.expanded = true;
                    }
                }
                List <ProfilerTimelineGUI.ThreadInfo> threads    = groupInfo.threads;
                ProfilerTimelineGUI.ThreadInfo        threadInfo = threads.Find((ProfilerTimelineGUI.ThreadInfo t) => t.threadIndex == i);
                if (threadInfo == null)
                {
                    threadInfo             = new ProfilerTimelineGUI.ThreadInfo();
                    threadInfo.name        = profilerFrameDataIterator.GetThreadName();
                    threadInfo.height      = 0f;
                    threadInfo.weight      = (threadInfo.desiredWeight = (float)((!groupInfo.expanded) ? 0 : 1));
                    threadInfo.threadIndex = i;
                    groupInfo.threads.Add(threadInfo);
                }
                if (threadInfo.weight != threadInfo.desiredWeight)
                {
                    threadInfo.weight = threadInfo.desiredWeight * time + (1f - threadInfo.desiredWeight) * (1f - time);
                }
                num += threadInfo.weight;
            }
            float num2 = 16f * (float)groupCount;
            float num3 = r.height - num2;
            float num4 = num3 / (num + 2f);

            foreach (ProfilerTimelineGUI.GroupInfo current in this.groups)
            {
                foreach (ProfilerTimelineGUI.ThreadInfo current2 in current.threads)
                {
                    current2.height = num4 * current2.weight;
                }
            }
            this.groups[0].expanded          = true;
            this.groups[0].height            = 0f;
            this.groups[0].threads[0].height = 3f * num4;
        }
Esempio n. 2
0
        private void DrawBars(Rect r, int frameIndex)
        {
            ProfilerFrameDataIterator profilerFrameDataIterator = new ProfilerFrameDataIterator();

            profilerFrameDataIterator.SetRoot(frameIndex, 0);
            int threadCount = profilerFrameDataIterator.GetThreadCount(frameIndex);

            if (Event.current.type == EventType.Repaint)
            {
                for (int i = 0; i < threadCount; i++)
                {
                    profilerFrameDataIterator.SetRoot(frameIndex, i);
                    float threadY   = this.GetThreadY(r, i, threadCount);
                    float height    = this.GetThreadY(r, i + 1, threadCount) - threadY;
                    Rect  position  = new Rect(r.x - 170f, threadY, 170f, height);
                    Rect  position2 = new Rect(r.x, threadY, r.width, height);
                    ProfilerTimelineGUI.styles.rightPane.Draw(position2, false, false, false, false);
                    ProfilerTimelineGUI.styles.leftPane.Draw(position, GUIContent.Temp(profilerFrameDataIterator.GetThreadName()), false, false, false, false);
                }
            }
        }
 private void CalculateBars(Rect r, int frameIndex, float time)
 {
   ProfilerFrameDataIterator frameDataIterator = new ProfilerFrameDataIterator();
   int groupCount = frameDataIterator.GetGroupCount(frameIndex);
   float num1 = 0.0f;
   frameDataIterator.SetRoot(frameIndex, 0);
   int threadCount = frameDataIterator.GetThreadCount(frameIndex);
   // ISSUE: object of a compiler-generated type is created
   // ISSUE: variable of a compiler-generated type
   ProfilerTimelineGUI.\u003CCalculateBars\u003Ec__AnonStoreyAD barsCAnonStoreyAd = new ProfilerTimelineGUI.\u003CCalculateBars\u003Ec__AnonStoreyAD();
   // ISSUE: reference to a compiler-generated field
   // ISSUE: reference to a compiler-generated field
   // ISSUE: reference to a compiler-generated field
   // ISSUE: reference to a compiler-generated field
   for (barsCAnonStoreyAd.i = 0; barsCAnonStoreyAd.i < threadCount; barsCAnonStoreyAd.i = barsCAnonStoreyAd.i + 1)
   {
     // ISSUE: object of a compiler-generated type is created
     // ISSUE: variable of a compiler-generated type
     ProfilerTimelineGUI.\u003CCalculateBars\u003Ec__AnonStoreyAC barsCAnonStoreyAc = new ProfilerTimelineGUI.\u003CCalculateBars\u003Ec__AnonStoreyAC();
     // ISSUE: reference to a compiler-generated field
     barsCAnonStoreyAc.\u003C\u003Ef__ref\u0024173 = barsCAnonStoreyAd;
     // ISSUE: reference to a compiler-generated field
     frameDataIterator.SetRoot(frameIndex, barsCAnonStoreyAd.i);
     // ISSUE: reference to a compiler-generated field
     barsCAnonStoreyAc.groupname = frameDataIterator.GetGroupName();
     // ISSUE: reference to a compiler-generated method
     ProfilerTimelineGUI.GroupInfo groupInfo = this.groups.Find(new Predicate<ProfilerTimelineGUI.GroupInfo>(barsCAnonStoreyAc.\u003C\u003Em__1F5));
     if (groupInfo == null)
     {
       groupInfo = new ProfilerTimelineGUI.GroupInfo();
       // ISSUE: reference to a compiler-generated field
       groupInfo.name = barsCAnonStoreyAc.groupname;
       groupInfo.height = 20f;
       groupInfo.expanded = false;
       groupInfo.threads = new List<ProfilerTimelineGUI.ThreadInfo>();
       this.groups.Add(groupInfo);
       // ISSUE: reference to a compiler-generated field
       // ISSUE: reference to a compiler-generated field
       if (barsCAnonStoreyAc.groupname == string.Empty || barsCAnonStoreyAc.groupname == "Unity Job System")
         groupInfo.expanded = true;
     }
     // ISSUE: reference to a compiler-generated method
     ProfilerTimelineGUI.ThreadInfo threadInfo1 = groupInfo.threads.Find(new Predicate<ProfilerTimelineGUI.ThreadInfo>(barsCAnonStoreyAc.\u003C\u003Em__1F6));
     if (threadInfo1 == null)
     {
       threadInfo1 = new ProfilerTimelineGUI.ThreadInfo();
       threadInfo1.name = frameDataIterator.GetThreadName();
       threadInfo1.height = 0.0f;
       ProfilerTimelineGUI.ThreadInfo threadInfo2 = threadInfo1;
       ProfilerTimelineGUI.ThreadInfo threadInfo3 = threadInfo1;
       int num2 = !groupInfo.expanded ? 0 : 1;
       double num3;
       float num4 = (float) (num3 = (double) num2);
       threadInfo3.desiredWeight = (float) num3;
       double num5 = (double) num4;
       threadInfo2.weight = (float) num5;
       // ISSUE: reference to a compiler-generated field
       threadInfo1.threadIndex = barsCAnonStoreyAd.i;
       groupInfo.threads.Add(threadInfo1);
     }
     if ((double) threadInfo1.weight != (double) threadInfo1.desiredWeight)
       threadInfo1.weight = (float) ((double) threadInfo1.desiredWeight * (double) time + (1.0 - (double) threadInfo1.desiredWeight) * (1.0 - (double) time));
     num1 += threadInfo1.weight;
   }
   float num6 = 16f * (float) groupCount;
   float num7 = (r.height - num6) / (num1 + 2f);
   using (List<ProfilerTimelineGUI.GroupInfo>.Enumerator enumerator1 = this.groups.GetEnumerator())
   {
     while (enumerator1.MoveNext())
     {
       using (List<ProfilerTimelineGUI.ThreadInfo>.Enumerator enumerator2 = enumerator1.Current.threads.GetEnumerator())
       {
         while (enumerator2.MoveNext())
         {
           ProfilerTimelineGUI.ThreadInfo current = enumerator2.Current;
           current.height = num7 * current.weight;
         }
       }
     }
   }
   this.groups[0].expanded = true;
   this.groups[0].height = 0.0f;
   this.groups[0].threads[0].height = 3f * num7;
 }
Esempio n. 4
0
        private void CalculateBars(ref ProfilerFrameDataIterator iter, Rect r, int frameIndex, float time)
        {
            float num = 0f;

            iter.SetRoot(frameIndex, 0);
            int threadCount = iter.GetThreadCount(frameIndex);
            int i;

            for (i = 0; i < threadCount; i++)
            {
                iter.SetRoot(frameIndex, i);
                string groupname = iter.GetGroupName();
                ProfilerTimelineGUI.GroupInfo groupInfo = this.groups.Find((ProfilerTimelineGUI.GroupInfo g) => g.name == groupname);
                if (groupInfo == null)
                {
                    groupInfo          = new ProfilerTimelineGUI.GroupInfo();
                    groupInfo.name     = groupname;
                    groupInfo.height   = 20f;
                    groupInfo.expanded = false;
                    groupInfo.threads  = new List <ProfilerTimelineGUI.ThreadInfo>();
                    this.groups.Add(groupInfo);
                }
                List <ProfilerTimelineGUI.ThreadInfo> threads    = groupInfo.threads;
                ProfilerTimelineGUI.ThreadInfo        threadInfo = threads.Find((ProfilerTimelineGUI.ThreadInfo t) => t.threadIndex == i);
                if (threadInfo == null)
                {
                    threadInfo             = new ProfilerTimelineGUI.ThreadInfo();
                    threadInfo.name        = iter.GetThreadName();
                    threadInfo.height      = 0f;
                    threadInfo.weight      = (threadInfo.desiredWeight = (float)((!groupInfo.expanded) ? 0 : 1));
                    threadInfo.threadIndex = i;
                    groupInfo.threads.Add(threadInfo);
                }
                threadInfo.alive = true;
                if (threadInfo.weight != threadInfo.desiredWeight)
                {
                    threadInfo.weight = threadInfo.desiredWeight * time + (1f - threadInfo.desiredWeight) * (1f - time);
                }
                num += threadInfo.weight;
            }
            float num2 = 0f;

            foreach (ProfilerTimelineGUI.GroupInfo current in this.groups)
            {
                if (current.threads.Count > 1)
                {
                    num2 += (current.expanded ? Math.Max(current.height, (float)current.threads.Count * 2f) : current.height);
                }
            }
            float num3 = r.height - num2;
            float num4 = num3 / (num + 1f);

            foreach (ProfilerTimelineGUI.GroupInfo current2 in this.groups)
            {
                foreach (ProfilerTimelineGUI.ThreadInfo current3 in current2.threads)
                {
                    current3.height = num4 * current3.weight;
                }
            }
            this.groups[0].expanded = true;
            this.groups[0].height   = 0f;
            if (this.groups[0].threads.Count > 0)
            {
                this.groups[0].threads[0].height = 2f * num4;
            }
        }
Esempio n. 5
0
 private void DrawBars(Rect r, int frameIndex)
 {
     ProfilerFrameDataIterator iterator = new ProfilerFrameDataIterator();
     iterator.SetRoot(frameIndex, 0);
     int threadCount = iterator.GetThreadCount(frameIndex);
     if (Event.current.type == EventType.Repaint)
     {
         for (int i = 0; i < threadCount; i++)
         {
             iterator.SetRoot(frameIndex, i);
             float y = this.GetThreadY(r, i, threadCount);
             float height = this.GetThreadY(r, i + 1, threadCount) - y;
             Rect position = new Rect(r.x - 170f, y, 170f, height);
             Rect rect2 = new Rect(r.x, y, r.width, height);
             styles.rightPane.Draw(rect2, false, false, false, false);
             styles.leftPane.Draw(position, GUIContent.Temp(iterator.GetThreadName()), false, false, false, false);
         }
     }
 }
Esempio n. 6
0
        private void CalculateBars(Rect r, int frameIndex, float time)
        {
            ProfilerFrameDataIterator frameDataIterator = new ProfilerFrameDataIterator();
            int   groupCount = frameDataIterator.GetGroupCount(frameIndex);
            float num1       = 0.0f;

            frameDataIterator.SetRoot(frameIndex, 0);
            int threadCount = frameDataIterator.GetThreadCount(frameIndex);

            // ISSUE: object of a compiler-generated type is created
            // ISSUE: variable of a compiler-generated type
            ProfilerTimelineGUI.\u003CCalculateBars\u003Ec__AnonStoreyAD barsCAnonStoreyAd = new ProfilerTimelineGUI.\u003CCalculateBars\u003Ec__AnonStoreyAD();
            // ISSUE: reference to a compiler-generated field
            // ISSUE: reference to a compiler-generated field
            // ISSUE: reference to a compiler-generated field
            // ISSUE: reference to a compiler-generated field
            for (barsCAnonStoreyAd.i = 0; barsCAnonStoreyAd.i < threadCount; barsCAnonStoreyAd.i = barsCAnonStoreyAd.i + 1)
            {
                // ISSUE: object of a compiler-generated type is created
                // ISSUE: variable of a compiler-generated type
                ProfilerTimelineGUI.\u003CCalculateBars\u003Ec__AnonStoreyAC barsCAnonStoreyAc = new ProfilerTimelineGUI.\u003CCalculateBars\u003Ec__AnonStoreyAC();
                // ISSUE: reference to a compiler-generated field
                barsCAnonStoreyAc.\u003C\u003Ef__ref\u0024173 = barsCAnonStoreyAd;
                // ISSUE: reference to a compiler-generated field
                frameDataIterator.SetRoot(frameIndex, barsCAnonStoreyAd.i);
                // ISSUE: reference to a compiler-generated field
                barsCAnonStoreyAc.groupname = frameDataIterator.GetGroupName();
                // ISSUE: reference to a compiler-generated method
                ProfilerTimelineGUI.GroupInfo groupInfo = this.groups.Find(new Predicate <ProfilerTimelineGUI.GroupInfo>(barsCAnonStoreyAc.\u003C\u003Em__1F5));
                if (groupInfo == null)
                {
                    groupInfo = new ProfilerTimelineGUI.GroupInfo();
                    // ISSUE: reference to a compiler-generated field
                    groupInfo.name     = barsCAnonStoreyAc.groupname;
                    groupInfo.height   = 20f;
                    groupInfo.expanded = false;
                    groupInfo.threads  = new List <ProfilerTimelineGUI.ThreadInfo>();
                    this.groups.Add(groupInfo);
                    // ISSUE: reference to a compiler-generated field
                    // ISSUE: reference to a compiler-generated field
                    if (barsCAnonStoreyAc.groupname == string.Empty || barsCAnonStoreyAc.groupname == "Unity Job System")
                    {
                        groupInfo.expanded = true;
                    }
                }
                // ISSUE: reference to a compiler-generated method
                ProfilerTimelineGUI.ThreadInfo threadInfo1 = groupInfo.threads.Find(new Predicate <ProfilerTimelineGUI.ThreadInfo>(barsCAnonStoreyAc.\u003C\u003Em__1F6));
                if (threadInfo1 == null)
                {
                    threadInfo1        = new ProfilerTimelineGUI.ThreadInfo();
                    threadInfo1.name   = frameDataIterator.GetThreadName();
                    threadInfo1.height = 0.0f;
                    ProfilerTimelineGUI.ThreadInfo threadInfo2 = threadInfo1;
                    ProfilerTimelineGUI.ThreadInfo threadInfo3 = threadInfo1;
                    int    num2 = !groupInfo.expanded ? 0 : 1;
                    double num3;
                    float  num4 = (float)(num3 = (double)num2);
                    threadInfo3.desiredWeight = (float)num3;
                    double num5 = (double)num4;
                    threadInfo2.weight = (float)num5;
                    // ISSUE: reference to a compiler-generated field
                    threadInfo1.threadIndex = barsCAnonStoreyAd.i;
                    groupInfo.threads.Add(threadInfo1);
                }
                if ((double)threadInfo1.weight != (double)threadInfo1.desiredWeight)
                {
                    threadInfo1.weight = (float)((double)threadInfo1.desiredWeight * (double)time + (1.0 - (double)threadInfo1.desiredWeight) * (1.0 - (double)time));
                }
                num1 += threadInfo1.weight;
            }
            float num6 = 16f * (float)groupCount;
            float num7 = (r.height - num6) / (num1 + 2f);

            using (List <ProfilerTimelineGUI.GroupInfo> .Enumerator enumerator1 = this.groups.GetEnumerator())
            {
                while (enumerator1.MoveNext())
                {
                    using (List <ProfilerTimelineGUI.ThreadInfo> .Enumerator enumerator2 = enumerator1.Current.threads.GetEnumerator())
                    {
                        while (enumerator2.MoveNext())
                        {
                            ProfilerTimelineGUI.ThreadInfo current = enumerator2.Current;
                            current.height = num7 * current.weight;
                        }
                    }
                }
            }
            this.groups[0].expanded          = true;
            this.groups[0].height            = 0.0f;
            this.groups[0].threads[0].height = 3f * num7;
        }
Esempio n. 7
0
        private void CalculateBars(ref ProfilerFrameDataIterator iter, Rect r, int frameIndex, float time)
        {
            float visibleThreadCount = 0;

            iter.SetRoot(frameIndex, 0);
            int threadCount = iter.GetThreadCount(frameIndex);

            for (int i = 0; i < threadCount; ++i)
            {
                iter.SetRoot(frameIndex, i);
                string    groupname = iter.GetGroupName();
                GroupInfo group     = groups.Find(g => g.name == groupname);
                if (group == null)
                {
                    group          = new GroupInfo();
                    group.name     = groupname;
                    group.height   = kGroupHeight;
                    group.expanded = false;
                    group.threads  = new List <ThreadInfo>();
                    groups.Add(group);
                }
                var threads = group.threads;

                ThreadInfo thread = threads.Find(t => t.threadIndex == i);
                if (thread == null)
                {
                    thread             = new ThreadInfo();
                    thread.name        = iter.GetThreadName();
                    thread.height      = 0;
                    thread.weight      = thread.desiredWeight = group.expanded ? 1 : 0;
                    thread.threadIndex = i;
                    group.threads.Add(thread);
                }
                thread.alive = true;

                if (thread.weight != thread.desiredWeight)
                {
                    thread.weight = thread.desiredWeight * time + (1 - thread.desiredWeight) * (1 - time);
                }

                visibleThreadCount += thread.weight;
            }

            var groupheight = 0.0f;

            foreach (var group in groups)
            {
                if (group.threads.Count > 1)
                {
                    groupheight += !group.expanded ? group.height : Math.Max(group.height, group.threads.Count * 2.0f);
                }
            }
            var remaining       = r.height - groupheight;
            var heightPerThread = remaining / (visibleThreadCount + 1); // main thread gets 2 times the space

            foreach (var group in groups)
            {
                foreach (var thread in group.threads)
                {
                    thread.height = heightPerThread * thread.weight;
                }
            }

            groups[0].expanded = true;
            groups[0].height   = 0;
            if (groups[0].threads.Count > 0)
            {
                groups[0].threads[0].height = 2 * heightPerThread;
            }
        }