void Awake() { if (instance != null) { Destroy(this.gameObject); Debug.LogWarning("More than one instance of PersisntSceneManagementComponent found!"); return; } DontDestroyOnLoad(transform.gameObject); instance = this; }
// Use this for initialization void Start() { sceneManagementComponent = PersisntSceneManagementComponent.instance; StartAsyncLoadScene(sceneManagementComponent.pathOfScene); }