void Awake() { contactPointId = 0; humanModelId = 0; imagePath = null; dontDestroyController = GameObject.Find("DontDestroy").GetComponent <DontDestroyController>(); }
private void Awake() { if (_instance != null) { Destroy(this.gameObject); } else { _instance = this; DontDestroyOnLoad(this); } }
// Use this for initialization void Awake() { if (instance != null) { Destroy(gameObject); } else if (instance == null) { // Here we save our singleton instance instance = this; //Debug.Log("instance saved as " + this); // Furthermore we make sure that we don't destroy between scenes (this is optional) DontDestroyOnLoad(gameObject); } }