Exemplo n.º 1
0
    private void InitUserDataFile(string filename)
    {
        if (filename.Equals("OXUserData.json"))
        {
            for (int i = 1; i < 21; i++)
            {
                OXUserData u = null;
                if (i == 1)
                {
                    u = new OXUserData(i, "true", "false");
                }
                else
                {
                    u = new OXUserData(i, "false", "false");
                }

                if (u != null)
                {
                    UserDataManager.Instance.AddUserOXProgressList(i, u);
                }
            }
        }

        if (filename.Equals("SentenceUserData.json"))
        {
            for (int i = 1; i < 21; i++)
            {
                SentenceUserData uu = null;
                if (i == 1)
                {
                    uu = new SentenceUserData(i, "true", "false");
                }
                else
                {
                    uu = new SentenceUserData(i, "false", "false");
                }
                if (uu != null)
                {
                    UserDataManager.Instance.AddSentenceUserProgressList(i, uu);
                }
            }
        }
        if (filename.Equals("UserStudyVocabData.json"))
        {
        }
        if (filename.Equals("UserStudySentenceData.json"))
        {
        }
        string str = string.Empty;

        if (filename.Equals("OXUserData.json"))
        {
            var list = UserDataManager.Instance.GetUserOXProgressList();
            str = JsonUtility.ToJson(new Serialization <int, OXUserData>(list));
        }
        if (filename.Equals("SentenceUserData.json"))
        {
            var list = UserDataManager.Instance.GetUserSentenceProgressList();
            str = JsonUtility.ToJson(new Serialization <int, SentenceUserData>(list));
        }
        if (filename.Equals("UserStudyVocabData.json"))
        {
            var list = UserDataManager.Instance.GetUserStudyVocabList();
            str = JsonUtility.ToJson(new Serialization <string, string>(list));
        }
        if (filename.Equals("UserStudySentenceData.json"))
        {
            var list = UserDataManager.Instance.GetUserSentenceList();
            str = JsonUtility.ToJson(new Serialization <int, string>(list));
        }
        Debug.Log(str);
        CreateJsonFile(str, filename);
    }
Exemplo n.º 2
0
 public void AddUserOXProgressList(int n, OXUserData d)
 {
     oxProgressList.Add(n, d);
 }