private static void LoadResultsScene(Scene resultScene, LoadSceneMode y) { ResultSceneManager resultSceneManager = null; foreach (GameObject obj in resultScene.GetRootGameObjects()) { ResultSceneManager comp; if ((comp = obj.GetComponent <ResultSceneManager>()) != null) { resultSceneManager = comp; } } if (resultSceneManager == null) { throw new Exception("No scene manager found"); } resultSceneManager.Load(Instance.result); Destroy(Instance); SceneManager.sceneLoaded -= LoadResultsScene; }
void Start() { resultScene = GameObject.Find("ResultSceneManager").GetComponent <ResultSceneManager>(); button = gameObject.GetComponent <Button>(); }