Skip to content

Instantly share code, notes, and snippets.

@glitchersgames
Created July 8, 2016 14:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save glitchersgames/b5ea291315dcd8ba2e1dbdddd2d14f4c to your computer and use it in GitHub Desktop.
Save glitchersgames/b5ea291315dcd8ba2e1dbdddd2d14f4c to your computer and use it in GitHub Desktop.
public override bool OnLobbyServerSceneLoadedForPlayer(GameObject lobbyPlayerObject, GameObject gamePlayerObject)
{
LobbyPlayer lobbyPlayer = lobbyPlayerObject.GetComponent<LobbyPlayer>();
Player gamePlayer = gamePlayerObject.GetComponent<Player>();
// set the SyncVar
gamePlayer.m_PlayerNumber = lobbyPlayer.m_PlayerNumber;
// setup for the server
gamePlayer.SetPlayerDef( lobbyPlayer.playerDef );
return true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment