private void Awake() { DontDestroyOnLoad(this); instance = this; if (GameObject.Find(gameObject.name) && GameObject.Find(gameObject.name) != this.gameObject) { Destroy(GameObject.Find(gameObject.name)); } }
private void Awake() { //pickcontrolObj = GameObject.Find("PickerController"); //dontdestroyedObject = GameObject.Find("DontDestroyObject"); DontDestroyScript = GameObject.Find("DontDestroyObject").GetComponent <DontDestoryOnLoadScript>(); }