public List <UM_Score> GetScoresList(UM_TimeSpan span, UM_CollectionType collection) { List <UM_Score> scores = new List <UM_Score>(); if (IsValid) { switch (Application.platform) { case RuntimePlatform.Android: if (UltimateMobileSettings.Instance.PlatformEngine.Equals(UM_PlatformDependencies.Android)) { List <GPScore> gp = gp_Leaderboard.GetScoresList(span.Get_GP_TimeSpan(), collection.Get_GP_CollectionType()); foreach (GPScore score in gp) { scores.Add(new UM_Score(null, score, null)); } return(scores); } else { List <GC_Score> gcScores = gc_Leaderboard.GetScoresList(span.Get_GC_TimeSpan()); foreach (GC_Score s in gcScores) { scores.Add(new UM_Score(null, null, s)); } return(scores); } case RuntimePlatform.IPhonePlayer: List <GK_Score> gk = gk_Leaderboard.GetScoresList(span.Get_GK_TimeSpan(), collection.Get_GK_CollectionType()); foreach (GK_Score score in gk) { scores.Add(new UM_Score(score, null, null)); } return(scores); } } return(scores); }
public UM_Score GetScore(int rank, UM_TimeSpan scope, UM_CollectionType collection) { UM_Score umScore = null; if (IsValid) { switch (Application.platform) { case RuntimePlatform.Android: if (UltimateMobileSettings.Instance.PlatformEngine.Equals(UM_PlatformDependencies.Android)) { GPScore gp = gp_Leaderboard.GetScore(rank, scope.Get_GP_TimeSpan(), collection.Get_GP_CollectionType()); if (gp != null) { umScore = new UM_Score(null, gp, null); } } else { GC_Score gc = gc_Leaderboard.GetScore(rank, scope.Get_GC_TimeSpan()); if (gc != null) { umScore = new UM_Score(null, null, gc); } } break; case RuntimePlatform.IPhonePlayer: GK_Score gk = gk_Leaderboard.GetScore(rank, scope.Get_GK_TimeSpan(), collection.Get_GK_CollectionType()); if (gk != null) { umScore = new UM_Score(gk, null, null); } break; } } return(umScore); }
public void LoadTopScores(UM_Leaderboard leaderboard, int maxResults, UM_TimeSpan timeSpan = UM_TimeSpan.ALL_TIME, UM_CollectionType collection = UM_CollectionType.GLOBAL) { if (leaderboard == null) { return; } switch (Application.platform) { case RuntimePlatform.IPhonePlayer: GameCenterManager.LoadScore(leaderboard.IOSId, 1, maxResults, timeSpan.Get_GK_TimeSpan(), collection.Get_GK_CollectionType()); break; case RuntimePlatform.Android: if (UltimateMobileSettings.Instance.PlatformEngine == UM_PlatformDependencies.Amazon) { SA_AmazonGameCircleManager.Instance.LoadTopScores(leaderboard.AmazonId, timeSpan.Get_GC_TimeSpan()); } else { GooglePlayManager.Instance.LoadTopScores(leaderboard.AndroidId, timeSpan.Get_GP_TimeSpan(), collection.Get_GP_CollectionType(), maxResults); } break; } }