I'm trying to set up a character selection menu for my game, so it can have a VS mode where the player and enemy choice will spawn once the match starts. I know I need to use booleans to do it, but my mind is a bit foggy to the rest.
asked Feb 11 '11 at 04:08 AM
You'll want to set up a class that contains information about both the prefab to spawn and any GUIContent associated with the character. The simplest example would be:
Store a bunch of these in some collection (like an Array).
In your GUI, you'll need to keep track of which player has selected which player, which you can do by keeping an int for each player. So your GUI script may start out something like...
I don't know how your character selection screen input is supposed to work, but you simply change the number associated with whichever player selected a character, ie, for player 1:
Assuming player 1 selected the fifth character in
And change Awake to say
And just before you load the fight scene, record those selections:
When the fightScene loads, have some script get the players and instantiate them (presuming your character selection scene GUI script is CharacterSelection.js:
answered Feb 18 '11 at 04:27 PM