本文整理汇总了C#中JSONObject.GetLong方法的典型用法代码示例。如果您正苦于以下问题:C# JSONObject.GetLong方法的具体用法?C# JSONObject.GetLong怎么用?C# JSONObject.GetLong使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JSONObject
的用法示例。
在下文中一共展示了JSONObject.GetLong方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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");
}
示例2: 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]); });
}
示例3: 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);
}
示例4: 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);
}
}
示例5: 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")));
}
示例6: OnPlayerJoinRoom
public void OnPlayerJoinRoom(string roomId, JSONObject userData) {
if (this.roomId == roomId) {
PlayerSlotScript playerSlot = GetAvailableSlot(userData.GetString("username"));
playerSlot.Init(userData.GetString("username"), userData.GetString("displayName"), userData.GetLong("cash"), userData.GetString("avatar"));
} else {
Debug.LogError("Not in this room " + this.roomId + " | " + roomId);
}
}
示例7: EventViewMessage
public void EventViewMessage(JSONObject message) {
selectMessage = message;
Utils.SetActive(scrollview.gameObject, false);
Utils.SetActive(viewMessagePanel, true);
Utils.SetActive(btnBack.gameObject, true);
messageTitle.text = message.GetString("title");
messageContent.text = message.GetString("message");
int goldVal = message.GetInt("goldVal");
int gemVal = message.GetInt("gemVal");
if (goldVal <= 0 && gemVal <= 0) {
Utils.SetActive(goldObject, false);
Utils.SetActive(gemObject, false);
EventDelegate.Set(btnClaim.onClick, delegate() {});
Utils.SetActive(btnClaim.gameObject, false);
} else {
Utils.SetActive(goldObject, goldVal > 0);
Utils.SetActive(gemObject, gemVal > 0);
goldLabel.text = goldVal.ToString("N0");
gemLabel.text = gemVal.ToString("N0");
rewardTable.Reposition();
Utils.SetActive(btnClaim.gameObject, true);
EventDelegate.Set(btnClaim.onClick, delegate() { ClaimReward(message.GetInt("type"), message.GetLong("createdAt"), message.GetString("fromUsername")); });
}
}
示例8: ClaimDailyRewardSuccess
void ClaimDailyRewardSuccess(JSONObject data) {
ErrorCode.USER errorCode = (ErrorCode.USER)data.GetInt("errorCode");
if (errorCode == ErrorCode.USER.NULL) {
Debug.Log("ClaimDailyRewardSuccess-- " + data.ToString());
AccountManager.Instance.lastClaimedDaily = data.GetLong("lastDaily");
AccountManager.Instance.UpdateUserCash(data.GetLong("cash"));
if (ScreenManager.Instance.SelectGameScreen != null) {
ScreenManager.Instance.SelectGameScreen.ClaimedDailyRewardCallback();
}
} else {
Debug.Log("ClaimDailyRewardFail-- " + data.ToString());
HUDManager.Instance.AddFlyText(errorCode.ToString(), Vector3.zero, 40, Color.red);
}
}