Exemple #1
0
    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);
    }
Exemple #2
0
    /// <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);
    }
Exemple #3
0
    /// <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);
    }