Search Unity

What's the best way to load popup, full-screen windows?

Discussion in 'General Discussion' started by chilton, May 6, 2019.

  1. chilton

    chilton

    Joined:
    May 6, 2008
    Posts:
    564
    Hi,

    I'm trying to create a menu system where the entire screen is temporarily taken over, while the player remains 'in' the world.

    For example, you walk up to a barkeep, and the 3D game cuts to a 2D picture of the barkeep with some words on the screen, and a button to accept and one to cancel. When the screen goes away, you resume playing.

    What I have been doing for the last umpteen years is creating a prefab of the UI elements, and turning them on and off. I did that with nGUI and now uGUI, and I assume that's just how it's done.

    But I'm curious if anyone does something like this, with the addScene additively. Is that a better way to do it?

    Thanks!
    -Chilton
     
  2. kdgalla

    kdgalla

    Joined:
    Mar 15, 2013
    Posts:
    4,639
    It would have to read from disk every time you brought-up a menu which is significantly less performant. I wouldn't, unless you have lots of hi-res images in your different menu screens and, together, they take up an unreasonable amount of memory.
     
  3. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    If you have several of these full screen windows which pop up and just show different content, I'd just have a single window as part of the scene which has a control script which controls what to change text fields to and enable/disable child objects. Effectively using a single window to be reused each time.

    That is of course if the content of these windows is not so memory hungry that it would be a problem having all of it loaded into memory at the same time.