Search Unity

Dealing with lots of "screens" and cameras

Discussion in 'UGUI & TextMesh Pro' started by dogfacedesign, Nov 10, 2018.

  1. dogfacedesign

    dogfacedesign

    Joined:
    Jan 10, 2016
    Posts:
    70
    So in my game, I have a number of different screens (more than 12) that are shown to the player. It is more of a simulation than a game, per se. At any rate, at one point I had them all on one camera, which made editing the screens a pain in the butt because I would always have to use the inspector to disable the screens I wasn't working on, make the change to the one that needed it, re-enable them all, then test.

    So, I decided to create separate cameras, one for each screen, and spread the UI for those screens across those cameras. It makes editing a heck of a lot easier (even though NGUI didn't play too well all the time).

    I am curious if my approach sounds "reasonable", or perhaps there are other ways I could deal with it. I am ok with the way it is now, I suppose, but I'm always willing to learn new approaches to solving problems!

    Cheers.
     
  2. MD_Reptile

    MD_Reptile

    Joined:
    Jan 19, 2012
    Posts:
    2,664
    There are performance issues with having lots of cameras (though probably avoidable if you disable/enable them selectively) - but I have always just used either multiple canvas objects, or multiple panels under the canvas to hold each potential "screen" for the game. Honestly though - if you aren't experiencing lag or glitches, there is no reason not to just do what works best for your workflow.
     
  3. I wouldn't do that if you don't have any use of the multiple cameras run time. If it's purely editing tool, I would rather write a small script which show a bunch of buttons and on click enable/disable the proper "screen" for you automatically. Or a dropdown or something like that.