unity dontdestroyonload in awake code example
Example: is start called after dontdestroyonload
void Start(){
DontDestroyOnLoad (gameObject);
}
// how to call start/awake when loading a new scene on an object
// that has DontDestroyOnLoad.
void OnLevelWasLoaded(){
Debug.Log ("A new scene was loaded");
}