You need to use the Display
class to activate and change resolution of additional displays.
You can access the additional displays using Display.display[i]
, where i
is the display index (main = 0, 2nd = 1, etc.).
Use
Display.display[i].Activate(display_width, display_height, display_refreshRate)
to activate the additional displays.
Edit: to answer your question in the comment, to make a secondary display go fullscreen, you just need to set its resolution to the native one:
Display.displays[1].Activate();
Display.displays[1].SetRenderingResolution(Display.displays[1].systemWidth,
Display.displays[1].systemHeight);
or, directly,
Display.displays[1].Activate(Display.displays[1].systemWidth,
Display.displays[1].systemHeight, 60);
if the refresh rate is 60 (with the second method, you can't read inside Unity the refresh rate of the secondary display, so you need to know it before hand, or just use SetRenderingResolution
to let the graphic card drivers choose it without bothering).
Another important info that I forgot to mention: when inside the Editor, the number of displays reported by the Display
class will always be one, the correct number will be reported only in a standalone build (and it only works for PC/Mac/Linux builds).