本文整理汇总了C#中JSONObject.GetInt方法的典型用法代码示例。如果您正苦于以下问题:C# JSONObject.GetInt方法的具体用法?C# JSONObject.GetInt怎么用?C# JSONObject.GetInt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JSONObject
的用法示例。
在下文中一共展示了JSONObject.GetInt方法的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: 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]); });
}
示例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 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");
}
示例5: 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));
}
}
}
示例6: LoadInboxDataSuccess
void LoadInboxDataSuccess(JSONObject data) {
PopupManager.Instance.CloseLoadingPopup();
ErrorCode.USER errorCode = (ErrorCode.USER)data.GetInt("errorCode");
if (errorCode == ErrorCode.USER.NULL) {
if (PopupManager.Instance != null && PopupManager.Instance.PopupInbox != null) {
PopupManager.Instance.PopupInbox.LoadInboxCallback(data.GetArray("inbox"));
}
}
}
示例7: LoadLeaderboardDataSuccess
void LoadLeaderboardDataSuccess(JSONObject data) {
LeaderboardScreen.Tab selectedTab = (LeaderboardScreen.Tab)data.GetInt("type");
LeaderboardScreen.SetData( data.GetArray("users"), selectedTab);
Debug.Log("LoadLeaderboardDataSuccess " + data.ToString());
if (ScreenManager.Instance.LeaderboardScreen != null) {
ScreenManager.Instance.LeaderboardScreen.ShowTopPlayer(selectedTab);
}
PopupManager.Instance.CloseLoadingPopup();
}
示例8: ClaimInboxRewardSuccess
void ClaimInboxRewardSuccess(JSONObject data) {
PopupManager.Instance.CloseLoadingPopup();
ErrorCode.USER errorCode = (ErrorCode.USER)data.GetInt("errorCode");
if (errorCode == ErrorCode.USER.NULL) {
if (PopupManager.Instance != null && PopupManager.Instance.PopupInbox != null) {
PopupManager.Instance.PopupInbox.ClaimRewardSuccess(data);
}
} else {
HUDManager.Instance.AddFlyText(errorCode.ToString(), Vector3.zero, 40, Color.red);
}
}
示例9: 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")));
}
示例10: TLMBGameConfig
public TLMBGameConfig(JSONObject jsonData) {
type = (Type)jsonData.GetInt("type");
coinPerCard = jsonData.GetInt("coinPerCard");
firstRankRewardCoin = jsonData.GetInt("firstRankRewardCoin");
secondRankRewardCoin = jsonData.GetInt("secondRankRewardCoin");
}
示例11: Read
public void Read( JSONObject obj )
{
X = obj.GetInt("x");
Y = obj.GetInt("y");
}
示例12: ClaimRewardSuccess
// TO DO: update gem val
public void ClaimRewardSuccess(JSONObject jsonData) {
Debug.Log("ClaimRewardSuccess " + jsonData.ToString());
AccountManager.Instance.UpdateUserCash(jsonData.GetInt("goldVal"));
AccountManager.Instance.UpdateUserGem(jsonData.GetInt("gemVal"));
JSONObject message;
for (int i = 0; i < messageList.Length; i++) {
message = messageList[i].Obj;
if (message.GetLong("createdAt") == selectMessage.GetLong("createdAt") && message.GetInt("type") == selectMessage.GetInt("type") && (string.IsNullOrEmpty(selectMessage.GetString("fromUsername")) || message.GetString("fromUsername") == selectMessage.GetString("fromUsername"))) {
messageList.Remove(i);
break;
}
}
EventBackToListMessages();
InitScrollViewData();
HUDManager.Instance.AddFlyText(Localization.Get("PopupInbox_ClaimSuccess"), Vector3.zero, 40, Color.green);
}
示例13: 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")); });
}
}
示例14: Load
public override void Load(JSONObject obj)
{
TotalScore = obj.GetInt("needScore");
}
示例15: SpinData
public SpinData(string username, JSONObject jsonData, bool isYou) {
Debug.Log("SpinData: " + jsonData.ToString());
this.isYou = isYou;
this.username = username;
JSONArray resultsData = jsonData.GetArray("items");
JSONObject extraData = SlotCombination.CalculateCombination(resultsData, jsonData.GetInt("nL"));
JSONArray winningCount = extraData.GetArray("wCount");
JSONArray winningType = extraData.GetArray("wType");
JSONArray winningGold = jsonData.GetArray("wGold");
for (int i = 0; i < winningGold.Length; i++) {
totalDamage += (int)winningGold[i].Number;
}
if (jsonData.ContainsKey("newBoss")) {
newBossData = jsonData.GetObject("newBoss");
JSONArray bossDrops = jsonData.GetArray("dropItems");
dropCash = (int)bossDrops[0].Number;
dropGem = (int)bossDrops[1].Number;
bossDrops = null;
AccountManager.Instance.bossKilled++;
}
for (int i = 0; i < winningCount.Length; i++) {
if (winningCount[i].Number >= 3 || ((int)winningType[i].Number == (int)SlotItem.Type.TILE_1 && winningCount[i].Number >= 2)) {
spawnSkills.Add(new SpawnableSkill((int)winningType[i].Number, (int)winningCount[i].Number, (int)winningGold[i].Number, isYou));
}
}
extraData = null;
resultsData = null;
winningCount = null;
winningType = null;
winningGold = null;
}