void Pass() { SceneInfo_Json json = new SceneInfo_Json(); int index = 0; string SceneName = SceneManager.GetActiveScene().name;//获取场景名称 switch (SceneName) { case "Scenes_1": index = 2; break; case "Scenes_2": index = 3; break; case "Scenes_3": index = 4; break; case "Scenes_4": index = 5; break; case "Scenes_5": index = 6; break; } if (index == 6) { return; } json.sceneinfo = json.GetDirectoryState(index); json.sceneinfo.isPass = 1; json.SetDirectoryState(json.sceneinfo); }
void init() { suo = GameObject.Find("Canvas/suo"); l1 = GameObject.Find("Canvas/Button_1"); l2 = GameObject.Find("Canvas/Button_2"); l3 = GameObject.Find("Canvas/Button_3"); l4 = GameObject.Find("Canvas/Button_4"); l5 = GameObject.Find("Canvas/Button_5"); sendlevel = GameObject.Find("/SendLevel"); GameObject[] levlBt = new GameObject[5] { l1, l2, l3, l4, l5 }; SceneInfo_Json json = new SceneInfo_Json(); for (int i = 2; i <= 5; i++) { json.sceneinfo = json.GetDirectoryState(i); if (json.sceneinfo.isPass == 0) { AddObject(levlBt[i - 1], suo); levlBt[i - 1].GetComponent <Button>().interactable = false; } } }
void init() { int index = 0; string SceneName = SceneManager.GetActiveScene().name;//获取场景名称 switch (SceneName) { case "Scenes_1": index = 1; break; case "Scenes_2": index = 2; break; case "Scenes_3": index = 3; break; case "Scenes_4": index = 4; break; case "Scenes_5": index = 5; break; } json = new SceneInfo_Json(); json.sceneinfo = json.GetDirectoryState(index); }