batuman
batuman

Reputation: 7304

Selection of Canvas or Panel or Scene for UI in Unity

I am making an iOS application using unity. We have 3 options for UI elements such as button, user's text key in and image, logo display etc.

I have about 8 pages in my iOS app. The first page is user login, second page is selection buttons for different game levels, third page is display of previous results, etc.

I am making UI pages and I am wondering which option to choose in terms of game's response. As this is my first app using Unity, I like to have opinions from expertises.

Which options would be best for game response and unity design among the followings.

(1)All pages are designed on different scenes and I will have 8 scenes. Each scene has its own UI elements.

(2)One scene, but different canvases for different pages. So each canvas has its own UI elements for different pages.

(3)One scene, one canvas, but different panels for different pages. So each panel has its own UI elements for different pages.

What could be the best option for my app? If somebody discuss advantages and disadvantages for different options, it would be great.

Upvotes: 1

Views: 1414

Answers (2)

pale bone
pale bone

Reputation: 1836

I'd go with number 2 because you can just deactivate irrelevant canvases and draw only those currently active. This will be more performant than option 3 and afford smoother transitions than option 1. If you're running out of memory then split the scene in half, etc. With only 8 pages your state machine doesn't sound like it would be too difficult to manage. You can read about canvas performance here: https://unity3d.com/learn/tutorials/topics/best-practices/fill-rate-canvases-and-input?playlist=30089

Upvotes: 0

Mikko Koivisto
Mikko Koivisto

Reputation: 301

I mostly use combination of 1 and 3 or only 3.

Passing data between different scenes is more difficult than passing data between gameobjects within the same scene (i.e. requires static members/persistent data/gameobjects that won't be destroyed when the scene is being unloaded).

In single scene options, handling the game state becomes more complex (i.e. which gameobjects are active and visible in different phases of game flow).

It's easier to make transition effects with single scene option especially if two views are visible at the same time.

Upvotes: 0

Related Questions