#Mini-game Menu?

1 messages · Page 1 of 1 (latest)

north junco
#

Hello, this is moreso a Unity question than a programming one, but I don't know where else to ask.

I'm trying to create a main menu with a few buttons that all lead to different games. My question is, would I need to create all the different minigames (and the main menu) in different 'scenes'?

#

So like SampleScene, I'll have Game1, Game2, so on and so forth.

crude lichen
#

I mean... you don't need to. But I probably would 'cos it sounds easier.

You could also have some system that keeps references to a ton of objects and uses .setActive(false) to just hide ones not used in the current game.

#

Or depending on what kind of games they are, move the camera to show the diff games.

north junco
#

I see. Hadn't considered that (assumed Unity would do it automatically). Thanks for the tip.

north junco
#

I don't think it'd be that resource-intensive but it's my first time with Unity so I want to do it right.

crude lichen
#

Oh I see!
I took a 9 month game course and my teacher had a system where he added all the gameobjects relating to a game level into an array.

When the player got to lv2 iterated through the array with a for (or maybe a foreach?) loopto use .SetActive(false) to all of the lv 1 objects.

He'd have all the lv 2 things in a different array and called .SetActive(true) to activate all lv 2 things.

That way it switched levels without needing 2 scenes.
I've never done it myself, but maybe it would work for you.
That way you could keep everything in one scene.

But yea scenes are nice since everything in the last one is jsut destroyed and don't need to think about it as much.

north junco
north junco
#

I think I'll just go with the scene approach then.

#

The fact that everything BUT the active scene is automatically deleted makes it convenient.

crude lichen
#

Yeah, with scene changing the challenge is if you need to bring something over to other scenes. You'd need a singleton or some static fields.

But if you don't save anything then it's super easy.

north junco
#

Yeah, nothing to save accross scenes, if that's what you mean.

#

I'm going to have variables for objectives inside each scene.

#

But I don't think that should be an issue.

#

And all the assets in each different minigame are irrespective of each other.

crude lichen
#

Yep. In lots of games you need to bring like player score to other scenes or w/e.
Yeah and you can just use the same prefabs if you need menu buttons on many scenes.

north junco
#

What do you mean by menu buttons on many scenes?

#

This is essentially what my core UI will be like.

#

red = minigame icons
blue = settings

#

Is it advisable to create a different scene for the settings too?

crude lichen
#

What I mean is, I often make my menu system carry between scenes.
So that I can have the same buttons to go back to other scenes etc.

But you can just put copies of the same thing in many scenes and it's pretty much the same thing.

north junco
#

I see.

crude lichen
#

For settings, I often jsut have it be an UI panel that I activate to show and deactivate to hide

north junco
#

That makes more sense.

Thanks for all the help brother.