Search Unity

  1. Unity 2020.1 has been released.
    Dismiss Notice
  2. We are looking for feedback on the experimental Unity Safe Mode which is aiming to help you resolve compilation errors faster during project startup.
    Dismiss Notice
  3. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

SystemInfo.operatingSystem freezes debugger in Visual Studio

Discussion in 'Scripting' started by DoomDude99, Jul 27, 2019.

  1. DoomDude99


    May 11, 2019
    I'm trying to see if the platform the app is running on is Android:

    Code (CSharp):
    1.             if (!SystemInfo.operatingSystem.Contains(OS_WINDOWS_STR) && !SystemInfo.operatingSystem.Contains(OS_MAC_STR))
    2.             {
    3.                       ...
    I set a break point at this line but the debugger switches to unity when it's reached (and stepped over/into). I tried running the call on it's own:

    Code (CSharp):
    1.             string killMePlease = SystemInfo.operatingSystem;
    with the same result, unfortunately.

    What am I doing wrong? Can unity specific classes be debugged or not, or at least, can they be skipped in a sense that not being stepped into while debugging?

    I'm not sure why this happens.


    I'm calling that method from a static method in a thread. It works when called outside the thread. This is pretty strange.
    Last edited: Jul 27, 2019