Search Unity

SystemInfo.operatingSystem freezes debugger in Visual Studio

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

  1. DoomDude99

    DoomDude99

    Joined:
    May 11, 2019
    Posts:
    68
    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.

    Edit:

    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