Search Unity

Bug BuildPipeline.BuildPlayer Changes Editor's Build Settings

Discussion in 'Editor & General Support' started by aydin_khp, Jan 29, 2021.

  1. aydin_khp

    aydin_khp

    Joined:
    May 15, 2020
    Posts:
    29
    Hi,


    I use BuildPipeline.BuildPlayer which is called from a custom MenuItem to build the headless version of my multiplayer game for different targets (Linux and Windows) so that I don't have to:
    1. Go to the Build Settings window
    2. Change the target
    3. Enable Server Build
    4. Build
    5. Disable Server Build
    6. Change back the target
    7. List item

    Note: I have to change back all the setting because my server's target (Linux) is different from my client's target (Windows).

    The problem here is that the BuildPipeline.BuildPlayer changes the target setting on the Editor's Build Settings; As far I know this is the only field it changes and they remain the same. I think this is a bug, is that right? And if it is, how can I file a bug for unity?

    Look forward to hearing from you.

    Regards,
    Aydin