当前位置: 首页>>代码示例>>C#>>正文


C# JSONArray.ToString方法代码示例

本文整理汇总了C#中SimpleJSON.JSONArray.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# JSONArray.ToString方法的具体用法?C# JSONArray.ToString怎么用?C# JSONArray.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SimpleJSON.JSONArray的用法示例。


在下文中一共展示了JSONArray.ToString方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SaveXBuildData

    public void SaveXBuildData(string IMG_DATA, string start_code, string update_code)
    {
        XDebug.Log ("Begining save..");
        XBuildData xbuild = DPS.XBD;

        JSONArray json = new JSONArray ();
        JSONArray names = new JSONArray ();
        if (xbuild.names != null) {
            for (int i = 0; i < xbuild.names.GetLength(0); i++) {
                JSONArray nameline = new JSONArray ();
                for (int j = 0; j < xbuild.names.GetLength(1); j++) {
                    if (xbuild.names [i, j] != null)
                        nameline.Add (xbuild.names [i, j]);
                    else
                        nameline.Add ("null");
                }
                names.Add (nameline);
            }
        }
        json.Add("names", names);

        JSONArray types = new JSONArray ();
        if (xbuild.types != null) {
            for (int i = 0; i < xbuild.types.GetLength(0); i++) {
                JSONArray typeline = new JSONArray ();
                for (int j = 0; j < xbuild.types.GetLength(1); j++) {
                    if (xbuild.types [i, j] != null)
                        typeline.Add (xbuild.types [i, j] + "");
                    else
                        typeline.Add ("0");
                }
                types.Add (typeline);
            }
        }
        json.Add("types", types);

        json.Add("center_x", new JSONData(xbuild.center.x));
        json.Add("center_y", new JSONData(xbuild.center.y));

        XDebug.Log ("Saving... @id" + xbuild.db_id + " " + json.ToString());
        XDebug.Log ("Start code: \n" + start_code);
        XDebug.Log ("Update Code: \n" + update_code);

        //XDebug.Log ("Image data size: \n" + IMG_DATA.Length);
        Application.ExternalCall ("SaveXBuild", xbuild.db_id, xbuild.name, json.ToString (), IMG_DATA, start_code, update_code);
    }
开发者ID:thundercraker,项目名称:XBuilder,代码行数:46,代码来源:DatabaseAdapter.cs

示例2: GetRespuestas

	public void GetRespuestas(){
		
		if (N ["Mensajes"] [contPreg] ["Respuestas"] != null) {
			//devuelve las posibles respuestas
			respuestaJSON = N ["Mensajes"] [contPreg] ["Respuestas"].AsArray;
			print (respuestaJSON.ToString());
			for(int i = 0;i < respuestas.Length; i++){
				print(respuestaJSON[i]);
				respuestas [i].GetComponentInChildren<Text> ().text = respuestaJSON[i]["Texto"];
			}
		}

	}
开发者ID:Sountemp,项目名称:Juego,代码行数:13,代码来源:ReadScript.cs

示例3: ConvertListToJson

        private string ConvertListToJson(List<String> list)
        {
            if (list == null) {
                return null;
            }

            var jsonArray = new JSONArray ();

            foreach (var listItem in list) {
                jsonArray.Add (new JSONData (listItem));
            }

            return jsonArray.ToString ();
        }
开发者ID:tengontheway,项目名称:unity_sdk,代码行数:14,代码来源:AdjustiOS.cs

示例4: getBadgesWon

	public IEnumerator getBadgesWon(int p_idSG)
	{
		print ("--- get Badges ---");

		string URL = baseURL + "/badges/seriousgame/" + p_idSG + "/version/" + version + "/player/" + idPlayer;

		WWW www = new WWW(URL);
		
		// wait for the requst to finish
		yield return www;
		
		badgesWon = JSON.Parse(www.text).AsArray;
		print ("Badges received! " + badgesWon.ToString());
	}
开发者ID:RBrNx,项目名称:MathMathRevolution,代码行数:14,代码来源:EngAGe.cs

示例5: updateFeedback

	public IEnumerator updateFeedback(Action<JSONArray> callbackFeedback)
	{
		print ("--- update Feedback ---");
		
		string URL = baseURL + "/gameplay/" + idGameplay + "/feedback/";

		WWW www = new WWW(URL);
		
		// wait for the requst to finish
		yield return www;

		feedback = JSON.Parse(www.text).AsArray;
		print ("Feedback received! " + feedback.ToString());
		foreach (JSONNode f in feedback)
		{			
			// log badge
			if (string.Equals(f["type"], "BADGE"))
			{
				badgesWon.Add(f);
			}	
		}
		
		callbackFeedback (feedback);
	}
开发者ID:RBrNx,项目名称:MathMathRevolution,代码行数:24,代码来源:EngAGe.cs

示例6: updateScores

	public IEnumerator updateScores(Action<JSONArray> callbackScore)
	{
		print ("--- getScores ---");
		
		string URL = baseURL + "/gameplay/" + idGameplay + "/scores/";

		WWW www = new WWW(URL);
		
		// wait for the requst to finish
		yield return www;

		scores = JSON.Parse(www.text).AsArray;
		print ("Scores received! " + scores.ToString());
		callbackScore(scores);
	}
开发者ID:RBrNx,项目名称:MathMathRevolution,代码行数:15,代码来源:EngAGe.cs

示例7: startGameplay

	public IEnumerator startGameplay(int p_idSG, string sceneGame)
	{
		scores = new JSONArray ();
		feedback = new JSONArray ();
		seriousGame = new JSONNode();
				
		print ("--- startGameplay ---");

		string putDataString = "";
		
		// existing player
		if (idPlayer != -1)
		{		
			putDataString = 
				"{" + 
					"\"idSG\": " + p_idSG + 
					", \"version\": " + version + 
					", \"idPlayer\": " + idPlayer +
					"}";
		}
		// new player -> create one
		else 
		{
			putDataString = 
				"{" + 
					"\"idSG\": " + p_idSG + 
					", \"version\": " + version + 
					", \"idStudent\": " + idStudent +
					", \"params\": " + parameters.ToString() +
					"}";
		}
		print (putDataString);

		string URL = baseURL + "/gameplay/start";

		WWW www = new WWW(URL, Encoding.UTF8.GetBytes(putDataString), headers);
		
		// wait for the requst to finish
		yield return www;

		
		idGameplay = int.Parse(www.text);
		
		print ("Gameplay Started! id: " + idGameplay);
		print ("--- getScores ---");
		
		string URL2 = baseURL + "/gameplay/" + idGameplay + "/scores/";

		WWW www2 = new WWW(URL2);
		
		// wait for the requst to finish
		yield return www2;

		scores = JSON.Parse(www2.text).AsArray;
		print ("Scores received! " + scores.ToString());

        SceneManager.LoadScene(sceneGame);
    }
开发者ID:RBrNx,项目名称:MathMathRevolution,代码行数:58,代码来源:EngAGe.cs


注:本文中的SimpleJSON.JSONArray.ToString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。