private static Leaderboard GetLeaderboard(GPGScore gScore) { for (int i = 0, imax = EnumUtils.GetCount <Leaderboard>(); i < imax; i++) { if (gScore.leaderboardId == instance.leaderboardInfos[i].leaderboardId) { return((Leaderboard)i); } } return((Leaderboard)0); }
public List <GPGScore> CreateTestItems(int n) { List <GPGScore> scores = new List <GPGScore>(); for (int i = 0; i < n; i++) { var sc = new GPGScore(); sc.displayName = "Test Name" + i; sc.rank = i + 99999; sc.value = i + i + 888; scores.Add(sc); } return(scores); }
private void OnMyScoreLoaded(GPGScore score) { Leaderboard l = GetLeaderboard(score); if (_isMyScoreLoadedDict[l]) // Just get the 'all-time' score for once { return; } _isMyScoreLoadedDict[l] = true; if (debugMode) { Debug.Log("LeaderboardManager:OnMyScoreLoaded()"); DebugUtils.Log(score); } ProcessMyLoadedScore(l, score.value); }
private void AddGridLine(GPGScore score, Transform line) { var lbl1 = line.GetChild(0).GetComponent<UILabel>(); lbl1.text = score.rank.ToString(); var lbl2 = line.GetChild(1).GetComponent<UILabel>(); lbl2.text = score.displayName;//countScores.ToString(); if (lbl2.text.Length>20) lbl2.text = lbl2.text.Remove(20); //удаление избыточных символов var lbl3 = line.GetChild(2).GetComponent<UILabel>(); lbl3.text = score.value.ToString(); //destroedLines.ToString()+" "; // var sprite = line.GetSafeComponent<UISprite>(); if (MySocialMain.Instance.GetLocalPlayerInfo() != null && score.playerId == MySocialMain.Instance.GetLocalPlayerInfo().playerId) sprite.spriteName = "06_line_red"; else sprite.spriteName = "05_line"; }
private void AddGridLine(GPGScore score, Transform line) { var lbl1 = line.GetChild(0).GetComponent <UILabel>(); lbl1.text = score.rank.ToString(); var lbl2 = line.GetChild(1).GetComponent <UILabel>(); lbl2.text = score.displayName;//countScores.ToString(); if (lbl2.text.Length > 20) { lbl2.text = lbl2.text.Remove(20); //удаление избыточных символов } var lbl3 = line.GetChild(2).GetComponent <UILabel>(); lbl3.text = score.value.ToString(); //destroedLines.ToString()+" "; // var sprite = line.GetSafeComponent <UISprite>(); if (MySocialMain.Instance.GetLocalPlayerInfo() != null && score.playerId == MySocialMain.Instance.GetLocalPlayerInfo().playerId) { if (ccc == 0) { sprite.spriteName = "06_line_red"; } else { sprite.spriteName = "05_line"; } ccc++; } else { sprite.spriteName = "05_line"; } }
public void loadScoresSucceeded(string json) { loadScoresSucceededEvent.fire(GPGScore.listFromJson <GPGScore>(json)); }
private static void OnPlayerFriendsScoresLoaded(GPGScore score) { Debug.Log("OnPlayerFriendsScoresLoaded Sucess"); playerFriendsPosition = (int)score.rank; playerFriendsMaxRange = 0; isSearchingPlayerFriendsPosition = false; }
public LeaderboardEntry(GPGScore score) { this.name = score.displayName; this.rank = (int)score.rank; this.score = (int)score.value; }
public List<GPGScore> CreateTestItems(int n) { List<GPGScore> scores = new List<GPGScore>(); for (int i = 0; i < n; i++) { var sc = new GPGScore(); sc.displayName = "Full Name Full Name Full Name Full Name Full Name Full Name" + i; sc.rank = i+99999; sc.value = i+i+888; scores.Add(sc); } return scores; }