user9804443
user9804443

Reputation:

When to use scene or panel

I just have a question and I don't know exactly what to type on google.

I am making a game which is always instantiating scenes now on my login process I am trying to login wrong account so there should be something that needs to pop up like an error message

enter image description here

Now my question is . Is there going to be a problem when I build this up because there's a tons of them or it is just normal?

But basically when i try to input the correct id and password this scenes will be deleted.

Upvotes: 2

Views: 390

Answers (1)

Programmer
Programmer

Reputation: 125445

There shouldn't be a problem but this looks like an abuse of scene to me. You have too many unnecessary scenes.

Here is when you need to create or use a new scene:

1.Main Menu

This is the first scene that loads. By separating it with your game scene, you will increase loading time.

2.Game Levels

The levels in your game requires scene for each one. This makes loading them faster. You can also separate one scene into multiple ones if it's really a big scene. This also increases the speed of loading time.


You do not need scene for other things you have in your question. Those should be a UI Panels. You can create a panel by going to the GameObject ---> UI --> Panel menu. It's really easy to show/hide a panel.

For example, you have login and emergency panels:

public GameObject loginPanel;
public GameObject emergencyPanel;

to show the login panel, you disable or deactivate the emergency panel first then activate the login panel:

emergencyPanel.SetActive(false);
loginPanel.SetActive(true);

That's all you have to do.

Upvotes: 8

Related Questions