I'm completely lost on how to even begin moving data from one scene to another. Most of the tutorials i've seen involve immediately using the player's selection to do something -- "Click this hero to spawn them into the game and start playing." The first step for me is simply to know if BOTH players have clicked on the "start button" in my hero select screen before loading the "Game" scene.
So far i have an initial scene where photon joins/creates a room; when you click "play" it makes a room and puts you in a "waiting for players" scene. The waiting for players scene moves you to the lobby scene when playerlist.length == 2. In the lobby i've placed a "start" button. I want the scene to switch to "game" when BOTH players click that button. How do i do this? I think it's something along the lines of saving a variable "public bool isReady" to all players. This leads into me figuring out how to save a variable for which hero they've chosen. Which leads into spawning all chosen heroes in the "Game" scene after everyone has chosen.
Also I need photon to number the players, i think, so that the game will know which team they'll be on. For now i just want the first player who connects to be Player1 and the 2nd to be Player2. This variable allows them to control any gameObject tagged as "Player1." I do not want to simply instantiate a "player" object. Just like in RTS games, some players have more than 1 unit to control (I already have it set up RTS-style so i can left click a controllable unit and right click to move that specific gameobject.)
These are separate questions, an answer to either one would be greatly appreciated. Or, of course, advice on how you think i should be building my game differently.
So far i have an initial scene where photon joins/creates a room; when you click "play" it makes a room and puts you in a "waiting for players" scene. The waiting for players scene moves you to the lobby scene when playerlist.length == 2. In the lobby i've placed a "start" button. I want the scene to switch to "game" when BOTH players click that button. How do i do this? I think it's something along the lines of saving a variable "public bool isReady" to all players. This leads into me figuring out how to save a variable for which hero they've chosen. Which leads into spawning all chosen heroes in the "Game" scene after everyone has chosen.
Also I need photon to number the players, i think, so that the game will know which team they'll be on. For now i just want the first player who connects to be Player1 and the 2nd to be Player2. This variable allows them to control any gameObject tagged as "Player1." I do not want to simply instantiate a "player" object. Just like in RTS games, some players have more than 1 unit to control (I already have it set up RTS-style so i can left click a controllable unit and right click to move that specific gameobject.)
These are separate questions, an answer to either one would be greatly appreciated. Or, of course, advice on how you think i should be building my game differently.