Search Unity

How to enable High Detail mode in profiler with code

Discussion in 'Scripting' started by prayshouse, Sep 18, 2017.

  1. prayshouse

    prayshouse

    Joined:
    Sep 11, 2017
    Posts:
    27
    In CPU usage profiler, we can click the High Detail button to enable High Detail mode. I want to know how to enable High Detail mode with code.
    upload_2017-9-18_11-36-0.png

    Or where can I find the reference document about the namespace UnityEditorInternal?

    Any reply will be appreciated.
     
  2. lordofduct

    lordofduct

    Joined:
    Oct 3, 2011
    Posts:
    6,821
  3. prayshouse

    prayshouse

    Joined:
    Sep 11, 2017
    Posts:
    27
    I am on Unity 5.6 as well. Go to Window > Profiler, select the CPU Usage and click Timeline. Then you can see there is a High Detail button.
    upload_2017-9-18_15-3-15.png

    I want to find the reference document about namespace UnityEditor.UnityEditorIneternal. There are other classes such as ProfilerDriver to control the profiler. But I can not find such document.
    upload_2017-9-18_15-7-23.png

    Thank you for your reply.:)
     
  4. lordofduct

    lordofduct

    Joined:
    Oct 3, 2011
    Posts:
    6,821
    There is no reference documents for the internal stuff... it's considered internal.

    You can use the Object Explorer to search around it though, possibly find a method that looks like it'd get the job done, and then test it.
     
  5. prayshouse

    prayshouse

    Joined:
    Sep 11, 2017
    Posts:
    27
    OK, I will try. Thanks!
     
  6. Xepherys

    Xepherys

    Joined:
    Sep 9, 2012
    Posts:
    178
    UnityEditor.UnityEditorInternal namespace is not exposed and cannot be scripted (I've recently been trying this to script some NavAI UI stuff into my own editor scripts).

    Are you trying to enable high detail during execution when something specific occurs?
     
  7. prayshouse

    prayshouse

    Joined:
    Sep 11, 2017
    Posts:
    27
    Thank you for your reply. I am writing code to count the call stack time per frame at runtime. They are showed below in the profiler.
    upload_2017-9-19_17-35-57.png

    But in the default setting, the two item [Alloc] and [Dealloc] won't be recorded, so I have to enable High Detail mode. Then I can get the data I want.