Search Unity

Question BuildOptions.WaitForPlayerConnection VS EditorUserBuildSettings.waitForManagedDebugger

Discussion in 'Editor & General Support' started by hugeandy, Dec 2, 2022.

  1. hugeandy

    hugeandy

    Joined:
    Nov 2, 2016
    Posts:
    131
    What is the difference between
    BuildOptions.WaitForPlayerConnection
    and
    EditorUserBuildSettings.waitForManagedDebugger
    ? What do they both explicitly do.

    EditorUserBuildSettings.waitForManagedDebugger
    sounds straight forward and the docs backup what it sounds like it does.

    BuildOptions.WaitForPlayerConnection
    also sounds straight forward and the docs also back it up, however I'm unsure of what "Sets the Player to wait for player connection on player start." actually means.

    If there is a variable called
    WaitForPlayerConnection
    and the docs say "waits for player connection", I don't think this is helpful at all! We need some context and definitions of terms and maybe, if we're lucky, an example
     
  2. hugeandy

    hugeandy

    Joined:
    Nov 2, 2016
    Posts:
    131
    Bumpity bump
     
  3. Yuchen_Chang

    Yuchen_Chang

    Joined:
    Apr 24, 2020
    Posts:
    126
    Hello!
    I'm not really confident with the answer, but this is my thought:
    EditorUserBuildSettings.waitForManagedDebugger
    is especially for the option you can see in Build Settings > Script Debugging, that allows you to set breakpoint, etc. in your IDE's debugger to debug your player. (Doc)
    BuildOptions.WaitForPlayerConnection
    is similar, but is for Profiler and PlayerConnection / EditorConnection, which allows you to profile and send/receive arbitrary messages between editor and player.
    These two feature are at different contexts, and "maybe" they use different communication channels when sending/receiving messages, so separating them as different options sounds reasonable.