Hi,
Im working on a Game with only one Level.
But in this level you have much tries, how can i make it that it relodes the game comlete?
In this time it relodes the level whithout reseting the variables(i write in the script : Application.LoadLevel(1);).
How can i change this?
sorry for bad english
Cery
Store the key variables in a singleton, then reload the level, reference that singleton.
O is that embrassing… Sorry i completly forgot this Post. ![]()
Please don’t be angry with me.
I made it a dirferent way i thing, i wrote in every script a Line were all variables were reset.
Like this:
If (blablabla) {
bloblub = 0;
Bliblibli = false;
}
It was very much work ![]()
If only I had known! That i only must look here.
But i don’t know what a singleton is… I Googled but nothing…
I am German and typed in it in every translater but nothing.
Could you teach me how it works?
Or discribe what a singleton is with other words.
That would be fantastic!
Mouch mouch thanks
Cery
Ps: I hope you will have a laugh because of my English…
Hello Cery.
Curious, singleton pattern is something well known now a days.
O jea right sorry.
I’am too bad in scripting ![]()
Could someone give me an example script? On/in Wiki or other sides i don’t
Understand much. An example would help very. I found some on sides but i did not get them work.
On (or is int in?) Wiki there is a german side but i don’t know. Maybe unity didn’t know “Singleton” maybe
container or so?
I raked up the unity scripting reference but i don’t found much. Or am i again eyeless?
I hope an example is not too much work.
Cery.
Ok i tried different things but it won’t work.
I found this side:
http://answers.unity3d.com/questions/48970/saving-last-checkpoint-hit-when-reloading-scene-singletons
But i don’t know how to implement this.
I found things with “new Singleton” but what does this do? What would be saved in this Singleton, the object in the moment when initialisating? I don’t know, Help please
Cery
Ps: Sorry for bad English
Ok i found the solution: If i reload the scene it only reset the variables exept the static variables.
I must only manualy reset the static ones. To know what a singleton is would be good, but now it isn’t very important.
Much thanks
Cery