116 lines
2.9 KiB
C#
116 lines
2.9 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using System.IO;
|
|
using BingoBrain.Core;
|
|
|
|
using Newtonsoft.Json;
|
|
using UnityEngine;
|
|
|
|
namespace BingoBrain
|
|
{
|
|
public class NewTaskModel : BaseModel
|
|
{
|
|
#region 生命周期
|
|
protected override void OnInit()
|
|
{
|
|
}
|
|
|
|
protected override void OnDispose()
|
|
{
|
|
}
|
|
|
|
protected override void OnReset()
|
|
{
|
|
}
|
|
#endregion
|
|
|
|
#region 读取数据
|
|
protected override void OnReadData()
|
|
{
|
|
}
|
|
#endregion
|
|
|
|
#region 本地存储
|
|
protected override void WriteLocalStorage()
|
|
{
|
|
|
|
}
|
|
#endregion
|
|
|
|
#region 消息
|
|
protected override void AddListener()
|
|
{
|
|
|
|
}
|
|
protected override void RemoveListener()
|
|
{
|
|
|
|
}
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
// private static string jsonFilePath = Path.Combine(Application.persistentDataPath, "taskrecord1.json");
|
|
|
|
// public static void saveRecord(List<int> list)
|
|
// {
|
|
|
|
// string save = JsonConvert.SerializeObject(list);
|
|
// Debug.Log(save);
|
|
// if (File.Exists(jsonFilePath)) File.Delete(jsonFilePath);
|
|
// File.WriteAllText(jsonFilePath, save);
|
|
|
|
// }
|
|
// public static List<int> getTaskRecord()
|
|
// {
|
|
// if (File.Exists(jsonFilePath))
|
|
// {
|
|
// string jsonstr = File.ReadAllText(jsonFilePath);
|
|
|
|
// Debug.Log("-------------------------");
|
|
// Debug.Log(jsonstr);
|
|
// return JsonConvert.DeserializeObject<List<int>>(jsonstr);
|
|
// //return JsonUtility.FromJson<MyData>(json);
|
|
|
|
// }
|
|
// else
|
|
// {
|
|
// Debug.Log("Data file not found!");
|
|
// return new List<int>();
|
|
// }
|
|
// }
|
|
|
|
// private static string jsonFilePath_time = Path.Combine(Application.persistentDataPath, "timerecord2.json");
|
|
|
|
// public static void saveTimeRecord(List<int> list)
|
|
// {
|
|
|
|
// string save = JsonConvert.SerializeObject(list);
|
|
// Debug.Log(save);
|
|
// if (File.Exists(jsonFilePath_time)) File.Delete(jsonFilePath_time);
|
|
// File.WriteAllText(jsonFilePath_time, save);
|
|
|
|
// }
|
|
// public static List<int> getTimeRecord()
|
|
// {
|
|
// if (File.Exists(jsonFilePath_time))
|
|
// {
|
|
// string jsonstr = File.ReadAllText(jsonFilePath_time);
|
|
|
|
// Debug.Log("-------------------------");
|
|
// Debug.Log(jsonstr);
|
|
// return JsonConvert.DeserializeObject<List<int>>(jsonstr);
|
|
// //return JsonUtility.FromJson<MyData>(json);
|
|
|
|
// }
|
|
// else
|
|
// {
|
|
// Debug.Log("Data file not found!");
|
|
// return new List<int>();
|
|
// }
|
|
// }
|
|
}
|
|
|
|
}
|