本文整理汇总了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]); });
}
示例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);
}
示例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");
}
示例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");}
}
示例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);
}
示例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);
}
}
示例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;
}
示例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");
}
示例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);
}
}
示例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]); });
}
示例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();
}
示例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));
}
}
}
示例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")));
}
示例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");}
}
示例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");}
}