示例#1
0
 // Update is called once per frame
 void Update()
 {
     if (Input.GetKeyDown(KeyCode.A))
     {
         string json = File.ReadAllText(path);
         print(json);
         Data[] data = JsonHelperItem.FromJson <Data>(json);
         print(data[0].profile);
     }
 }
示例#2
0
    public void FillDataOnForm()
    {
        print("Guardando");
        dataTemp.profile = tempProfile;
        dataTemp.SetDate();

        dataList.Add(new Data(dataTemp));
        string json = JsonHelperItem.ToJson(dataList.ToArray(), true);

        File.WriteAllText(path, json);
    }
示例#3
0
 void RecoveryData()
 {
     if (File.Exists(path))
     {
         string json = File.ReadAllText(path);
         Data[] data = JsonHelperItem.FromJson <Data>(json);
         dataList = data.OfType <Data>().ToList();
         FillListMedic(dataList);
     }
     else
     {
         File.WriteAllText(path, "");
     }
 }
示例#4
0
    void RecoveryData()
    {
        if (File.Exists(path))
        {
            string json = File.ReadAllText(path);
            Data[] data = JsonHelperItem.FromJson <Data>(json);

            User[] users = new User[1];
            users[0] = new User("Macaco", "*****@*****.**", "nel", DataManager.Profile.MEDIC);

            SaveJSON saveJSON = new SaveJSON(data, users);
            json = JsonHelperItem.ToJson <Data>(data, true);
            string json2 = JsonHelperUser.ToJson <User>(users, true);
            FixJSONSave(json, json2, true);
            //print(json2);

            //dataList = data.OfType<Data>().ToList();
            //FillListMedic(dataList);
        }
        else
        {
            File.WriteAllText(path, "");
        }
    }