public static void ChooseSceneParams(string nextSceneParams) { if (nextSceneParams.StartsWith("_")) { nextSceneParams = nextSceneParams.Substring(1); } int lastIndexOf_ = nextSceneParams.LastIndexOf('_'); string substringScene = null; string substringSceneParam = null; if (lastIndexOf_ != -1) { substringScene = nextSceneParams.Substring(0, lastIndexOf_ - 1); substringSceneParam = nextSceneParams.Substring(lastIndexOf_); if (substringSceneParam.StartsWith("_")) { substringSceneParam = substringSceneParam.Substring(1); } } var allParamsOnGivenScene = allSceneAndParams[substringScene]; paramTONExtScene = null; foreach (var item in allParamsOnGivenScene) { if (item.data1 == nextSceneParams) { paramTONExtScene = item; } } UnityEngine.SceneManagement.SceneManager.LoadScene(paramTONExtScene.data2); }
public static void ChooseSceneParams(int nextScene) { paramTONExtScene = null; UnityEngine.SceneManagement.SceneManager.LoadScene(nextScene); }