public void RadioButtonSelected(RadioGroupView rgView, int position, RadioButtonView rbview) { AudioHandler.Instance.PlaySound(AudioSoundEnum.ButtonForNormal); ClearData(); rankType = EnumUtil.GetEnum <RankTypeEnum>(rbview.name); string rankName = RankTypeEnumTool.GetRankTypeName(rankType); //设置本地数据 SetLocalData(); //获取排行榜ID SteamHandler.Instance.GetLeaderboardId(rankName, this); }
/// <summary> /// 按钮-更新数据 /// </summary> public override void OnClickForUpdate() { base.OnClickForUpdate(); string rankName = RankTypeEnumTool.GetRankTypeName(rankType); long score = 0; GameDataBean gameData = GameDataHandler.Instance.manager.GetGameData(); UserAchievementBean userAchievement = gameData.GetAchievementData(); switch (rankType) { case RankTypeEnum.NumberForGetElementary: score = userAchievement.ownTrophyElementary; break; case RankTypeEnum.NumberForGetIntermediate: score = userAchievement.ownTrophyIntermediate; break; case RankTypeEnum.NumberForGetAdvanced: score = userAchievement.ownTrophyAdvanced; break; case RankTypeEnum.NumberForGetLegendary: score = userAchievement.ownTrophyLegendary; break; } int intScore = 0; if (score > int.MaxValue) { intScore = int.MaxValue; } else { intScore = (int)score; } string innName = gameData.GetInnAttributesData().innName; string playerName = gameData.userCharacter.baseInfo.name; SteamHandler.Instance.SetGetLeaderboardData(rankTypeId, intScore, innName + "-" + playerName, this); }
/// <summary> /// 按钮-更新数据 /// </summary> public override void OnClickForUpdate() { base.OnClickForUpdate(); GameDataBean gameData = GameDataHandler.Instance.manager.GetGameData(); string rankName = RankTypeEnumTool.GetRankTypeName(rankType); long score = GetScoreByType(rankType); int intScore = 0; if (score > int.MaxValue) { intScore = int.MaxValue; } else { intScore = (int)score; } string innName = gameData.GetInnAttributesData().innName; string playerName = gameData.userCharacter.baseInfo.name; SteamHandler.Instance.SetGetLeaderboardData(rankTypeId, intScore, innName + "-" + playerName, this); }