Unity - GameSparksUnity script on loading same scene again
T
Thomas Zeman
started a topic
over 5 years ago
Hi,
I have a question in regards to GameSparksUnity instances: My unity3d game has one main menu and several game scenes which all come back to the menu scene once a game finishes. In the main menu I have a GameObject with the GameSparksUnity script attached and I am observing log output that everytime I am returning to the menu scene the connection to GameSparks is reestablished. What is a pattern/best practice around this?
Best Regards,
Thomas
Best Answer
C
Customer Support
said
over 5 years ago
Hi Thomas,
If you put the GameObject with the GameSparksUnity Script into a scene before your Main Menu (such as a loading screen) you will be able to avoid this behavior when returning to your Main Menu after a game. The way you have it setup at the moment a new instance of the GameObject with the GameSparksUnity script is created every time you go back to the Main Menu.
Thanks,
Liam
1 Comment
Customer Support
said
over 5 years ago
Answer
Hi Thomas,
If you put the GameObject with the GameSparksUnity Script into a scene before your Main Menu (such as a loading screen) you will be able to avoid this behavior when returning to your Main Menu after a game. The way you have it setup at the moment a new instance of the GameObject with the GameSparksUnity script is created every time you go back to the Main Menu.
Thomas Zeman
Hi,
I have a question in regards to GameSparksUnity instances: My unity3d game has one main menu and several game scenes which all come back to the menu scene once a game finishes. In the main menu I have a GameObject with the GameSparksUnity script attached and I am observing log output that everytime I am returning to the menu scene the connection to GameSparks is reestablished. What is a pattern/best practice around this?
Best Regards,
Thomas
Hi Thomas,
If you put the GameObject with the GameSparksUnity Script into a scene before your Main Menu (such as a loading screen) you will be able to avoid this behavior when returning to your Main Menu after a game. The way you have it setup at the moment a new instance of the GameObject with the GameSparksUnity script is created every time you go back to the Main Menu.
Thanks,
Liam
Customer Support
Hi Thomas,
If you put the GameObject with the GameSparksUnity Script into a scene before your Main Menu (such as a loading screen) you will be able to avoid this behavior when returning to your Main Menu after a game. The way you have it setup at the moment a new instance of the GameObject with the GameSparksUnity script is created every time you go back to the Main Menu.
Thanks,
Liam
-
Documentation Notes
-
Design issues with user events
-
Using NoSQL
-
Runtime Collections vs Metadata Collections
-
Anonymous authentication from browser app
-
Modules
-
Movement With Unity
-
Problem with url parameters for downloadables
-
Querying NoSql GameSparks database
-
Challenge accesType
See all 2486 topics