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


C# JSONObject.GetString方法代码示例

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


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

示例1: UpdateRowData

  public void UpdateRowData(JSONObject data, LeaderboardScreen.Tab selectedTab) {
    rowData = data;
    
    if (AccountManager.Instance.IsYou(rowData.GetString("username"))) {
      background.spriteName = "PopupBackground";
    } else {
      background.spriteName = "Global_Window_Paper";
    }
    
    playerNameLabel.text = rowData.GetString("displayName");
    if (selectedTab == LeaderboardScreen.Tab.TOP_RICHER) {
      cashLabel.text = rowData.GetLong("cash").ToString("N0") + "$";
    } else {
      // cashLabel.text = Utils.Localize("Top_Winner_Match_Text", new string[1] {rowData.GetInt("winMatchNumb").ToString("N0")});
      cashLabel.text = Localization.Format("Top_Winner_Match_Text", rowData.GetInt("bossKill").ToString("N0"));
    }
    rank = rowData.GetInt("rank");
    if (rank <= 3) {
			Utils.SetActive(rankBackground, false);
			Utils.SetActive(rankIcon.gameObject, true);
      rankIcon.spriteName = "Chat_RankIcon0" + rank;
    } else {
			Utils.SetActive(rankBackground, true);
			Utils.SetActive(rankIcon.gameObject, false);
      rankLabel.text = rank.ToString();
    }
    eventTrigger.inputParams = new object[] {rowData.GetString("username")};
    EventDelegate.Set(eventTrigger.onClick, delegate() { EventShowUserInfo((string)eventTrigger.inputParams[0]); });
  }
开发者ID:markofevil3,项目名称:SlotMachine,代码行数:29,代码来源:TopPlayerRowScript.cs

示例2: AddChatToList

	public void AddChatToList(JSONObject jsonData) {
		string message = "";
		string newestMes = "";
    if (AccountManager.Instance.IsYou(jsonData.GetString("senderId"))) {
			message += "[999999]You:[-] ";
			newestMes += "[999999]You:[-] ";
		} else {
			message += "[999999]" + jsonData.GetString("senderName") + ":[-] ";
			newestMes += "[999999]" + jsonData.GetString("senderName") + ":[-] ";
		}
		message += "[000000]" + Utils.ChatUnescape(jsonData.GetString("message")) + "[-]";
		newestMes += "[FFFFFF]" + Utils.ChatUnescape(jsonData.GetString("message")) + "[-]";
		recentChatMes.text = newestMes;
		textList.Add(message);
	}
开发者ID:markofevil3,项目名称:SlotMachine,代码行数:15,代码来源:InGameChatBar.cs

示例3: SetUser

	public void SetUser(JSONObject user) {
	  username = user.GetString("username");
		password = user.GetString("password");
		displayName = user.GetString("displayName");
		cash = user.GetLong("cash");
		gem = user.GetInt("gem");
		bossKilled = user.GetInt("bossKill");
		lastClaimedDaily = user.GetLong("lastDaily");
		fbId = user.GetString("facebookId");
		avatarLink = user.GetString("avatar");
		lastReadInboxTime = user.GetLong("lastReadInboxTime");
		lastInboxTime = user.GetLong("lastInboxTime");
		Debug.Log("SetUser " + user.ToString());
		// friends = user.GetArray("friends");
	}
开发者ID:markofevil3,项目名称:SlotMachine,代码行数:15,代码来源:AccountManager.cs

示例4: init

 public void init(JSONObject json)
 {
     if(json.GetValue("Id") != null ){this.Id = json.GetString("Id");}
     if(json.GetValue("Account") != null ){this.Account = json.GetString("Account");}
     if(json.GetValue("AccountNumber") != null ){this.AccountNumber = json.GetString("AccountNumber");}
     if(json.GetValue("Contract") != null ){this.Contract = json.GetString("Contract");}
     if(json.GetValue("Description") != null ){this.Description = json.GetString("Description");}
     if(json.GetValue("Opportunity") != null ){this.Opportunitity = json.GetString("Opportunity");}
     if(json.GetValue("TotalAmount") != null ){this.TotalAmount = json.GetString("TotalAmount");}
     if(json.GetValue("EndDate") != null ){this.EndDate = json.GetString("EndDate");}
     if(json.GetValue("Name") != null ){this.Name = json.GetString("Name");}
     if(json.GetValue("OrderNumber") != null ){this.OrderNumber = json.GetString("OrderNumber");}
     if(json.GetValue("Owner") != null ){this.Owner = json.GetString("Owner");}
     if(json.GetValue("Type") != null ){this.Type = json.GetString("Type");}
     if(json.GetValue("Status") != null ){this.Status = json.GetString("Status");}
 }
开发者ID:CodeScience,项目名称:VRpportunity,代码行数:16,代码来源:Order.cs

示例5: UpdateRowData

  public void UpdateRowData(JSONObject data) {
    rowData = data;
		titleLabel.text = rowData.GetString("title");
		messageTimeSeconds = (int)((Utils.UTCNowMiliseconds() - data.GetLong("createdAt")) / 1000);
		timeLabel.text = Utils.GetTimePassed(messageTimeSeconds);
    EventDelegate.Set(eventTrigger.onClick, EventViewMessage);
  }
开发者ID:markofevil3,项目名称:SlotMachine,代码行数:7,代码来源:InboxRowScript.cs

示例6: UpdateRowData

 public void UpdateRowData(JSONObject data) {
   rowData = data;
   leftUserData = data.GetObject("left");
   if (data.ContainsKey("right")) {
     rightUserData = data.GetObject("right");
   } else {
     rightUserData = null;
   }
   if (leftUserData != null) {
     Utils.SetActive(leftUser, true);
     leftUsernameLabel.text = leftUserData.GetString("displayName");
     leftCheckbox.value = leftCheckboxState;
     EventDelegate.Set(leftCheckboxListener.onClick, delegate() { EventCheckboxChanged(true); });
   } else {
     Utils.SetActive(leftUser, false);
   }
   if (rightUserData != null) {
     Utils.SetActive(rightUser, true);
     rightUsernameLabel.text = rightUserData.GetString("displayName");
     rightCheckbox.value = rightCheckboxState;
     EventDelegate.Set(rightCheckboxListener.onClick, delegate() { EventCheckboxChanged(false); });
   } else {
     Utils.SetActive(rightUser, false);
   }
 }
开发者ID:markofevil3,项目名称:SlotMachine,代码行数:25,代码来源:InviteRowScript.cs

示例7: CreatePublicMessageObject

 private ISFSObject CreatePublicMessageObject(JSONObject jsonData, string commandId) {
   ISFSObject objOut = new SFSObject();
   objOut.PutByteArray("jsonData", Utils.ToByteArray(jsonData.ToString()));
   objOut.PutUtfString("message", jsonData.GetString("message"));
   objOut.PutUtfString("cmd", commandId);
   return objOut;
 }
开发者ID:markofevil3,项目名称:SlotMachine,代码行数:7,代码来源:GameBottomBarScript.cs

示例8: Init

	public void Init(JSONObject jsonData) {
		roomId = jsonData.GetString("roomId");
		userGames.Clear();
		JSONArray userGameArray = jsonData.GetArray("userGames");

		for (int i = 0; i < userGameArray.Length; i++) {
			userGames.Add(new TLMBGame(userGameArray[i].Obj));
		}

		droppedCards = new TLMBCombination(jsonData.GetString("droppedCards"));
		roundDroppedCards = new TLMBCombination(jsonData.GetString("roundDroppedCards"));
		activeUserSeatIndex = jsonData.GetInt("activeUserSeatIndex");
		state = (State)jsonData.GetInt("state");
		gameConfig = new TLMBGameConfig(jsonData.GetObject("gameConfig"));
		remainingSeconds = jsonData.GetInt("remainingSeconds");
	}
开发者ID:markofevil3,项目名称:SlotMachine,代码行数:16,代码来源:TLMBRoom.cs

示例9: UpdateRowData

  public void UpdateRowData(JSONObject data) {
		if (rowData != null && data.GetString("username") == rowData.GetString("username")) {
			return;
		}
    rowData = data;
		facebookID = rowData.GetString("facebookId");
    usernameLabel.text = data.GetString("displayName");
    cashLabel.text = data.GetLong("cash").ToString("N0");
		if (facebookID != null && facebookID != string.Empty) {
			NGUITools.SetActive(avatarTexture.gameObject, true);
			StartCoroutine(DisplayAvatar(facebookID));
		} else {
			NGUITools.SetActive(defaultAvatar, true);
			NGUITools.SetActive(avatarTexture.gameObject, false);
		}
  }
开发者ID:markofevil3,项目名称:SlotMachine,代码行数:16,代码来源:FriendRowScript.cs

示例10: UpdateData

 public void UpdateData(JSONObject data) {
   roomData = data;
   roomNumberLabel.text = data.GetString("name");
   minBetLabel.text = data.GetInt("minBet").ToString("N0");
   sitStatusLabel.text = data.GetInt("numUsers") + "/4";
   eventTrigger.inputParams = new object[] {roomData.GetString("id")};
   EventDelegate.Set(eventTrigger.onClick, delegate() { EventJoinSelectedRoom((string)eventTrigger.inputParams[0]); });
 }
开发者ID:markofevil3,项目名称:SlotMachine,代码行数:8,代码来源:RoomRowScript.cs

示例11: Player

    public Player(JSONObject json)
    {
        this.ducat = -1;
        this.player_name = json.GetString("name");
        this.team_id = 0;
        this.uid = json.GetString("uid");
        this.type = (PlayerType)Enum.Parse(typeof(PlayerType), json.GetString("type"));
        this.price = (int)json.GetNumber("price");
        this.proba = (int)json.GetNumber("proba");

        var stats = json.GetObject("stats");
        this.DEFAULTSTATS.Esquive = (int)stats.GetNumber("esquive");
        this.DEFAULTSTATS.Tacle = (int)stats.GetNumber("tacle");
        this.DEFAULTSTATS.Passe = (int)stats.GetNumber("passe");
        this.DEFAULTSTATS.Course = (int)stats.GetNumber("course");
        initialize_finaleStats();
    }
开发者ID:CanPayU,项目名称:SuperSwungBall,代码行数:17,代码来源:Player.cs

示例12: Init

	public void Init(JSONObject jsonData) {
		userId = jsonData.GetString("userId");
		seatIndex = jsonData.GetInt("seatIndex");
		isHost = jsonData.GetBoolean("isHost");
		state = (State)jsonData.GetInt("state");
		hand = new TLMBHand();

		if (SmartfoxClient.Instance.IsYou(userId)) {
			AddCards(jsonData.GetString("cards"));
		} else {
			int numCards = jsonData.GetInt("numCards");

			for (int i = 0; i < numCards; i++) {
				hand.AddCard(new TLMBCard(-1));
			}
		}
	}
开发者ID:markofevil3,项目名称:SlotMachine,代码行数:17,代码来源:TLMBGame.cs

示例13: DisplayUserInfo

  public void DisplayUserInfo(JSONObject mUser) {
		Debug.Log("mUser " + mUser.ToString());
		Utils.SetActive(userInfoPanel, true);
    user = mUser;
    displayNameLabel.text = user.GetString("displayName");
    cashLabel.text = user.GetLong("cash").ToString("N0");
    killLabel.text = user.GetInt("bossKill").ToString("N0");
		avatarLink = user.GetString("avatar");
		if (avatarLink != string.Empty) {
			NGUITools.SetActive(avatarSprite.gameObject, true);
			NGUITools.SetActive(defaultAvatar, false);
			StartCoroutine(DisplayAvatar());
		} else {
			NGUITools.SetActive(avatarSprite.gameObject, false);
			NGUITools.SetActive(defaultAvatar, true);
		}
		Utils.SetActive(btnAddFriend.gameObject, !AccountManager.Instance.IsFriend(user.GetString("username")));
  }
开发者ID:markofevil3,项目名称:SlotMachine,代码行数:18,代码来源:PopupUserInfo.cs

示例14: init

 public void init(JSONObject json)
 {
     if(json.GetValue("Id") != null ){this.Id = json.GetString("Id");}
     if(json.GetValue("IsActive") != null ){this.IsActive = json.GetString("IsActive");}
     if(json.GetValue("CreatedBy") != null ){this.CreatedBy = json.GetString("CreatedBy");}
     if(json.GetValue("LastModifiedBy") != null ){this.LastModifiedBy = json.GetString("LastModifiedBy");}
     if(json.GetValue("ProductCode") != null ){this.ProductCode = json.GetString("ProductCode");}
     if(json.GetValue("Description") != null ){this.Description = json.GetString("Description");}
     if(json.GetValue("Family") != null ){this.Family = json.GetString("Family");}
     if(json.GetValue("Name") != null ){this.Name = json.GetString("Name");}
 }
开发者ID:CodeScience,项目名称:VRpportunity,代码行数:11,代码来源:Product.cs

示例15: init

 public void init(JSONObject json)
 {
     if(json.GetValue("Id") != null ){this.Id = json.GetString("Id");}
     if(json.GetValue("IsActive") != null ){this.CreatedBy = json.GetString("IsActive");}
     if(json.GetValue("CreatedBy") != null ){this.CreatedBy = json.GetString("CreatedBy");}
     if(json.GetValue("Description") != null ){this.Description = json.GetString("Description");}
     if(json.GetValue("IsStandard") != null ){this.CreatedBy = json.GetString("IsStandard");}
     if(json.GetValue("LastModifiedBy") != null ){this.CreatedBy = json.GetString("LastModifiedBy");}
     if(json.GetValue("Name") != null ){this.CreatedBy = json.GetString("Name");}
 }
开发者ID:CodeScience,项目名称:VRpportunity,代码行数:10,代码来源:Pricebook.cs


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