Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Dynamically switch from Fullscreen(foreground) to background

Discussion in 'Scripting' started by eco_bach, Feb 19, 2020.

  1. eco_bach

    eco_bach

    Joined:
    Jul 8, 2013
    Posts:
    1,601
    I am building a desktop application that also must share the same screen with a web based (Nodejs) application.

    Since the Unity app must run full screen I need to somehow dynamically switch from fullscreen foreground to background(windowed?) n order to show the web application.

    Is this possible from within Unity?
     
  2. diXime

    diXime

    Joined:
    Oct 2, 2018
    Posts:
    162
    Hello,
    For switching between fullscreen and windowed, there is FullScreenMode.
    (not tested)
    Screen.fullScreenMode = Screen.fullScreenMode == FullScreenMode.FullScreenWindow ? FullScreenMode.Windowed : FullScreenMode.FullScreenWindow;


    But to foreground the application as such, I can't think of one, but it may exist.