Forum General Unity Scenes and QuickConnect

Any issues or discussions relating to Unity development are welcome here.

Unity Scenes and QuickConnect

Postby vancext » December 5th, 2012, 12:55 am

Heya! Still relatively new, but making steady progress, and just had a quick question about Unity scene handling in conjunction with PlayerIO.

In the game I'm developing, I have several Unity scenes, and each connects to a corresponding service room (Player.IO is largely just being used as server-side security for a single player experience at this point.)

Question is, whenever I change scenes, I need to initiate a whole new PlayerIO.Connect (or a new simpleConnect()), and I only want to have one login scene at the start of a game session. This means I have to store the username/password locally in some form to transition between game states. Is this a security risk at all? Is this even the best way to transition connection data between scenes?

I should also specify that target platforms are iOs/Android, and potentially PC or Browser.

Thanks for the help!
vancext
 
Posts: 16
Joined: November 14th, 2012, 1:51 am

Re: Unity Scenes and QuickConnect

Postby dreamora » December 5th, 2012, 8:43 am

there is no need to reinstantiate the whole thing.
Just ensure to not do the connect in something that extends MonoBehaviour,or mark it as DontDestroyOnLoad, or simply store the connection as a static
right now your problem is that the monobehaviour you have the connection etc stored on simply ceases to exist I guess.
dreamora
 
Posts: 225
Joined: March 2nd, 2012, 9:58 am

Re: Unity Scenes and QuickConnect

Postby vancext » December 6th, 2012, 12:13 am

Ahhh, I understand. Thank you dreamora! That's exactly what's happening. Fixed.
vancext
 
Posts: 16
Joined: November 14th, 2012, 1:51 am

Re: Unity Scenes and QuickConnect

Postby fair_wind_ » November 22nd, 2017, 10:14 am

I have the same issue. DontDestroy and/or static fields do not help, mb you know another way to store connection?
fair_wind_
 
Posts: 6
Joined: November 14th, 2017, 7:33 am


Return to General