public void ReturnToMainMenu() { ChangeSceneButton changeSceneObj = Instantiate(chSceneObjPrefab).GetComponent <ChangeSceneButton>(); changeSceneObj.SetSceneToLoad(SceneUtility.GetBuildIndexByScenePath("Assets/Scenes/" + areaToLoad + ".unity")); changeSceneObj.SetDestination(areaToLoad); changeSceneObj.ReturnToMainMenu(); }
public void LoadScreenExample() { ChangeSceneButton changeSceneObj = Instantiate(chSceneObjPrefab).GetComponent <ChangeSceneButton>(); changeSceneObj.SetSceneToLoad(SceneUtility.GetBuildIndexByScenePath("Assets/Scenes/" + areaToLoad + ".unity")); changeSceneObj.SetDestination(areaToLoad); changeSceneObj.ChangeScene(); // StartCoroutine(LoadingScreen()); }