Build player Display optioin

I have a c# script to auto build my player. Im using something like:
BuildPipeline.BuildPlayer(scenes,…)

I want to use some command line option we can have in the GUI for the player settings :
-Default Screen Width
-Default Screen Height
-Display Resolution Dialog
-Supported Aspect Ratios

Any idea how i can set these by command line ?

I’ve wrote a similar script. Here’s my solution: use Editor classes.

For instance, before actually calling the BuildPipeline.BuildPlayer function you can pop’up a window where you can set all these values (look at the window utilities proposed in EditorUtility). Then, propagate these values in a script attached to some game object of your scene hierarchy. You can retrieve this component with Object.FindObjectOfType.

This actually works if you’re building your player from the editor. However, the process would be almost the same building from batchmode. The next big thing would be to retrieve your values from the command line. Hum… How difficult is it? That’s your question I guess. Just look at http://answers.unity3d.com/questions/14093/how-can-the-unity-standalone-player-read-command-l.html and you’re done.

Ok, i understand the way you’re using to use some command line argument, But i still have some questions about it. Supposed i have got the display value… 500x500. I want to create the player with these value. Where i can set these value to build my player with this settings in batch, without the UI. The BuildPlayer c# command dont have any agrument to set the display. Ive seen some Screen.Display, but if i want to set to disabled, the “Dispaly Resolution Dialog” option before the BuildPlayer command in my c# script, wich command i can use?
Thats my question, where i can set the “Player Settings” before building it.

Thanks a lot for your help.

Ok, I think I understand what you want. Is the PlayerSettings class the thing you are looking for ?

Oh yeah, thats exaclty what im looking for.
Thanks Numid.