|
Post by DarkTonic Dev on Apr 1, 2015 23:37:18 GMT
When the Scene starts again, you will need to make sure that WorldVariableTracker's Awake method runs first, and then you're free to modify them.
I'd probably use the Script Execution Order screen in Unity for this.
|
|
ch001
New Member
Posts: 22
Posts: 22
|
Post by ch001 on Apr 2, 2015 13:49:22 GMT
Got it working  ty again.
|
|
|
Post by DarkTonic Dev on Apr 2, 2015 15:18:11 GMT
No problem, glad it works!
|
|
ch001
New Member
Posts: 22
Posts: 22
|
Post by ch001 on May 5, 2015 23:18:18 GMT
Hi, how do i remove the Persistance Mode in the WorldVariable script completely ? its giving me problems with saving and loading of my variables.
If i chose the Rest which i don't want, am not able to bring back the values that i saved with easy save and if i chose keep from previous am not able to delete all the values that i saved if the player wants to start the game again, it still show the values.
|
|
|
Post by DarkTonic Dev on May 6, 2015 0:26:07 GMT
You can't. It's either reset or keep the value from before. So you will need to let it do its thing and then change the values afterward with your script. The newest version of CGK includes the ability to fire custom event(s) when done initializing. You could hook into that and do a restore of your easy save values.
Let me know how that works for you.
|
|
ch001
New Member
Posts: 22
Posts: 22
|
Post by ch001 on May 6, 2015 11:59:01 GMT
I think am starting to understand Persistance Mode. just to be sure, let say you have 2 scene and have the LevelWaveSettings in them. In the 1st scene if i set the Persistance Mode "Keep" it will save any values added to the WorldVariables in the scene e.g gain coins and in the 2nd if i want to rest it back to 0 i just need to change the Persistance Mode to "Rest" in that scene right ?
If so how can i do that through code maybe calling the Rest function if the player wants to start the game again ?
For the custom event the sample scene doesn't really explain how to use it.
|
|
|
Post by DarkTonic Dev on May 6, 2015 15:23:41 GMT
Yes that is correct. To start the same game again (meaning all/some variables reset to starting value), normally I'd return them to the main menu Scene where certain variables reset, by setting them to "reset".
No the sample scene doesn't explain how to use custom events. But the readme does.
|
|
ch001
New Member
Posts: 22
Posts: 22
|
Post by ch001 on May 7, 2015 11:42:14 GMT
Ok thank you, almost gave up in using the Core Gamekit lol
|
|
|
Post by DarkTonic Dev on May 7, 2015 15:01:22 GMT
No problem.
|
|