Such as how much money the player has as he goes from scene to scene? This is probably extremely obvious, but after some googling and forum searching, I can’t find the answer.
call DontDestroyOnLoad on the script that has the needed info. This (as the name implies) doesn’t destroy the object when the new scene is loaded.
Take a look at
HTH
Hermit
the easyer way is to make a non monobehaviour script (name it CGlobals or something)
and give it static variables
class CGlobals {
static public int money = 0;
static public bool paused = false;
static void Startup(){
Debug.Log("Your stuff is my stuff and my stuff is my stuff");
}
}
We use a MonoBehaviour singleton pattern in all of our projects. The benefit over a normal class with a bunch of variables is the Inspector; you can link up any prefabs/assets you need.
Take a look at http://www.unifycommunity.com/wiki/index.php?title=AManagerClass