void Update() { //if (Input.GetMouseButtonDown(1)) //{ // Debug.Log("////////////////////////New Sheet//////////////////////////////////////"); // Debug.Log(sheet.Name); // Debug.Log(sheet.ST); //} //if (Input.GetMouseButtonDown(0)) //{ // string path = "C:/Users/Carson Sena/Characters/test.json"; // string jsonString = JsonUtility.ToJson(sheet.GetSaveData()); // System.IO.File.WriteAllText(path, jsonString); //} //if (Input.GetMouseButtonDown(0)) //{ // string path = "C:/Users/Carson Sena/Characters/test.json"; // string jsonString = System.IO.File.ReadAllText(path); // CharacterSaveData data = JsonUtility.FromJson<CharacterSaveData>(jsonString); // sheet = new CharacterSheet(data); //} //if (Input.GetMouseButtonDown(0)) //{ // string path = "C:/Users/Carson Sena/Maps/test.json"; // string jsonString = JsonUtility.ToJson(grid.GetSaveData()); // System.IO.File.WriteAllText(path, jsonString); //} if (Input.GetMouseButtonDown(0)) { string path = "C:/Users/Carson Sena/Maps/test.json"; string jsonString = System.IO.File.ReadAllText(path); GridSaveData data = JsonUtility.FromJson <GridSaveData>(jsonString); grid.Load(data); } }
public void Make(TMP_Text path) { //System.IO.File.WriteAllText(Path.Combine(Application.persistentDataPath, Path.Combine("Maps", path.text + ".json")), "Hello world"); string jsonString = System.IO.File.ReadAllText(Path.Combine(Application.persistentDataPath, Path.Combine("Maps", path.text + ".json"))); data = JsonUtility.FromJson <GridSaveData>(jsonString); saveh = data.height; saveW = data.width; PlayGame(); }
public void Make2(TMP_InputField bob) { GridH grid = Instantiate(prefab).GetComponent <GridH>(); if (int.TryParse(bob.text.Trim(), out int size)) { grid.width = size; grid.height = size; //grid.ManualCreate(); data = grid.GetSaveData(); saveh = size; saveW = size; } else { Debug.Log("not a number " + bob.text.Trim()); } PlayGame(); }
} // 0x0072FF20-0x00730000 public void CreateGridLoadTimng(GridSaveData data) { } // 0x00730000-0x007304C0