ToString() публичный Метод

public ToString ( ) : string
Результат string
Пример #1
0
 IEnumerator sendScore(JsonData obj)
 {
     WWWForm dataParameters = new WWWForm();
     dataParameters.AddField("scores", obj.ToString()); // stuur altijd als string.
     dataParameters.AddField("UserId" , LoginScript.userID);
     WWW www = new WWW(Url,dataParameters);
     yield return www;
 }
    // Use this for initialization
    void Start()
    {
        // Pass JsonMapper.ToJson method the player object (character instance). This converts the data to JSON format
        playerJson = JsonMapper.ToJson(player);

        // Now write the restulting data to our StreamingAssets folder
        File.WriteAllText(Application.streamingAssetsPath + "/Player.json", playerJson.ToString());
    }
Пример #3
0
    public void CreateSavaData()
    {
        createUserDataObejct();

        setData = LitJson.JsonMapper.ToJson(userData);
        Debug.Log(setData);

        File.WriteAllText(Application.dataPath + "/Resources/userData.json", setData.ToString());
    }
Пример #4
0
    public void writeFile()
    {
        //Lo que hacemos ahora es almacenar en una lista los niveles definidos segun la clase anteriores
        foreach (int key in m_dictionaryScore.Keys)
        {
            m_leveldef.Add(new levelsDef(key, m_dictionaryScore[key]));
        }

        //Serializamos esa lista y la escribimos en la ruta indicada.
        fileJson = JsonMapper.ToJson(m_leveldef);
        File.WriteAllText(Application.persistentDataPath + "/scoreLevels.json", fileJson.ToString());
    }
Пример #5
0
 static int ToString(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         LitJson.JsonData obj = (LitJson.JsonData)ToLua.CheckObject(L, 1, typeof(LitJson.JsonData));
         string           o   = obj.ToString();
         LuaDLL.lua_pushstring(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Пример #6
0
    public void DefaultSettingOK()
    {
        mapConfig.stage_id   = int.Parse(stageidText.text);
        mapConfig.author     = authorText.text;
        mapConfig.difficulty = difficultyText.text;

        //pattenList.Add(createSubObject("0", new int[] { 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0 }));
        //pattenList.Add(createSubObject("1", new int[] { 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1 }));
        //mainObject.pattern = pattenList.ToArray();
        createMainObejct(int.Parse(stageidText.text), authorText.text, difficultyText.text, 1);
        //Debug.Log(CustomJSON(0, new int[] { 1,0,1,0,1,1}));
        setData = LitJson.JsonMapper.ToJson(mainObject);
        Debug.Log(setData);
        //setData = LitJson.JsonMapper.ToJson(mapConfig) + CustomJSON(0, new int[] { 1, 0, 1, 0, 1, 1 });
        //Debug.Log(setData);
        File.WriteAllText(Application.dataPath + "/customSetting.json", setData.ToString());//CustomJSON(mapConfig.stage_id, mapConfig.author, mapConfig.difficulty, mapConfig.level, 0, new int[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }));

        Debug.Log(mapConfig.stage_id + " " + mapConfig.author + " " + mapConfig.difficulty);
        defaultSettingUI.gameObject.SetActive(false);
        editorUI.gameObject.SetActive(true);
    }
Пример #7
0
    private static void SendMessageToMobile(LitJson.JsonData data)
    {
        Utility.LogPrint(data.ToString());
        switch (Application.platform)
        {
        case RuntimePlatform.Android:
            AndroidJavaClass  jc = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
            AndroidJavaObject jo = jc.GetStatic <AndroidJavaObject> ("currentActivity");
            if (data.ToJson() != "")
            {
                jo.Call("UnityCallBack", data.ToJson());
            }
            break;

        case RuntimePlatform.IPhonePlayer:
                #if UNITY_IPHONE
            InteractInterface.UnityCallBack(data.ToJson());
                #endif
            break;

        default:
            break;
        }
    }
Пример #8
0
 public void SaveUserDataJSON()
 {
     setData = LitJson.JsonMapper.ToJson(userData);
     Debug.Log(setData);
     File.WriteAllText(Application.dataPath + "/Resources/userData.json", setData.ToString());
 }
Пример #9
0
 public void SaveJSON()
 {
     //pattenList.Add(createSubObject(0, new int[]{ 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0 }));
     //pattenList.Add(createSubObject(0, new int[]{ 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1 }));
     mainObject.pattern = pattenList.ToArray();
     //createMainObejct(101, "Jaehyuk", "Normal", 1);
     setData = LitJson.JsonMapper.ToJson(mainObject);
     Debug.Log(setData);
     File.WriteAllText(Application.dataPath + "/Resources/" + mainObject.stage_id + ".json", setData.ToString());
 }
Пример #10
0
 protected override void OnFinish(LitJson.JsonData backJsonData)
 {
     base.OnFinish(backJsonData);
     Debug.logger.Log(backJsonData.ToString());
 }
Пример #11
0
 //have to be implemented by the developers
 public void AppSettingsDidLoad(JsonData data)
 {
     Debug.Log(data.ToString());
 }
Пример #12
0
 private static float floatParse(LitJson.JsonData data)
 {
     return(float.Parse(data.ToString()));
 }
Пример #13
0
 private static object get_value(JsonData v)
 {
     if(v.IsString)
         return v.ToString();
     else if(v.IsInt)
         return  Convert.ToInt32(v.ToString());
     else if(v.IsLong)
         return  Convert.ToInt64(v.ToString());
     else if(v.IsDouble)
         return  Convert.ToDouble(v.ToString());
     else if(v.IsBoolean)
         return  Convert.ToBoolean(v.ToString());
     else
         return  v.ToString();
 }