Ejemplo n.º 1
0
    /**
     * JSONデータ読み込みボタン.
     */
    public void OnClickJsonLoadButton()
    {
        InputField fileNameInputField = GameObject.Find("FileNameInputField").GetComponent <InputField>();
        NKTextMan  textMan            = gameObject.GetComponent <NKTextMan> ();

        string strStream = textMan.readText("/Resources/Save/" + fileNameInputField.text);
    }
Ejemplo n.º 2
0
    static public void SaveAllJson()
    {
        foreach (JsonBuffer b in DataBuffer)
        {
#if true
            PlayerPrefs.SetString(b.path + b.file, b.json);
#else
            DirectoryUtils.SafeCreateDirectory(b.path);
            NKTextMan.saveText(b.path + b.file, b.json);
#endif
        }
    }
Ejemplo n.º 3
0
    /**
     * JSONデータ保存ボタン.
     */
    public void OnClickJsonSaveButton()
    {
        InputField fileNameInputField = GameObject.Find("FileNameInputField").GetComponent <InputField>();
        InputField jsonInput          = GameObject.Find("jsonInput").GetComponent <InputField>();
        NKTextMan  textMan            = gameObject.GetComponent <NKTextMan> ();

        //保存
        if (textMan.saveText("/Resources/Save/" + fileNameInputField.text, jsonInput.text))
        {
                  //保存成功
        }
        else
        {
                  //保存失敗
        }
    }
Ejemplo n.º 4
0
    static public string LoadJson(string path, string file)
    {
        string json = "";

        if (TitleDataLoad.instance.LoadData)
        {
            foreach (JsonBuffer b in DataBuffer)
            {
                if (b.path == path && b.file == file)
                {
                    return(b.json);
                }
            }
#if true
            json = PlayerPrefs.GetString(path + file, "");
#else
            string json = NKTextMan.readText(path + file);
#endif
        }
        DataBuffer.Add(new JsonBuffer(path, file, json));
        return(json);
    }