public void SaveBtn() { print("保存数据@@@"); saveJG = gameObject.GetComponent <SaveJG>(); saveJG.Save("web"); gameDataManager.Save(); }
public void ReadBtn() { GameObject wall_Temp = Resources.Load <GameObject>("Wall"); if (wall_Temp != null) { GameObject exist = GameObject.Find("Ground"); DestroyImmediate(exist); GameObject wall = Instantiate <GameObject>(wall_Temp); wall.name = "Ground"; wall.layer = 9; // wall.AddComponent<BoxCollider>(); wall.AddComponent <Dotdestroy>(); MeshRenderer[] wall_Gather = wall.transform.GetComponentsInChildren <MeshRenderer>(); print(wall_Gather.Length); for (int i = 0; i < wall_Gather.Length; i++) { wall_Gather[i].gameObject.AddComponent <BoxCollider>(); } } saveJG = gameObject.GetComponent <SaveJG>(); saveJG.Load("web"); InfoMessage[] infoMessageArray = GameObject.FindObjectsOfType <InfoMessage>(); for (int i = 0; i < infoMessageArray.Length; i++) { infoMessageArray[i].PushGoodObj();//List<InfoMessage> } SetObjParent setObj = GameObject.FindObjectOfType <SetObjParent>(); setObj.SetObjParentEvent(); SetAphlaShader setAphlaShader = GameObject.FindObjectOfType <SetAphlaShader>(); if (setAphlaShader != null) { setAphlaShader.EventStart(); } }