예제 #1
0
파일: Social.cs 프로젝트: ArtReeX/memoria
 public static void ReportAchievement(AcheivementKey key, String achievementId, Int32 percentageProgress, Action <Boolean> callback)
 {
     if (!Social.IsSocialPlatformAuthenticated())
     {
         return;
     }
     UnityEngine.Social.ReportProgress(achievementId, (Double)percentageProgress, callback);
 }
예제 #2
0
    public AchievementStatusesEnum GetNormalAchievementStatuses(AcheivementKey key)
    {
        if (AchievementState.IsSystemAchievement(key))
        {
            return(AchievementStatusesEnum.Invalid);
        }
        Int32 achievementIntIndex = this.GetAchievementIntIndex(key);
        Int32 achievementBitIndex = this.GetAchievementBitIndex(key);

        return(AchievementState.ConvertDataToAchievementStatus(this.EvtReservedArray[achievementIntIndex], achievementBitIndex));
    }
예제 #3
0
    private void ResetSteamAchievements()
    {
        SteamLocalUser steamLocalUser = UnityEngine.Social.Active.localUser as SteamLocalUser;

        if (steamLocalUser != null)
        {
            foreach (Object obj in Enum.GetValues(typeof(AcheivementKey)))
            {
                AcheivementKey key = (AcheivementKey)((Int32)obj);
                steamLocalUser.ClearAchievement(AchievementManager.GetRefKeyForPlatform(key));
            }
        }
    }
예제 #4
0
    public void SetNormalAchievementStatuses(AcheivementKey key, AchievementStatusesEnum status)
    {
        if (AchievementState.IsSystemAchievement(key))
        {
            return;
        }
        Int32 achievementIntIndex = this.GetAchievementIntIndex(key);
        Int32 achievementBitIndex = this.GetAchievementBitIndex(key);
        Int32 num  = AchievementState.ConvertAchievementStatusToData(status, achievementBitIndex);
        Int32 num2 = 3 << achievementBitIndex;

        this.EvtReservedArray[achievementIntIndex] &= ~num2;
        this.EvtReservedArray[achievementIntIndex] |= num;
    }
예제 #5
0
 private Int32 GetAchievementBitIndex(AcheivementKey key)
 {
     return((Int32)((Int32)key * (Int32)AcheivementKey.BlkMag100 % (Int32)AcheivementKey.Rope100));
 }
예제 #6
0
    private Int32 GetAchievementIntIndex(AcheivementKey key)
    {
        Int32 num = (Int32)((Int32)key * (Int32)AcheivementKey.BlkMag100 / (Int32)AcheivementKey.Rope100);

        return(2 + num);
    }
예제 #7
0
 public static Boolean IsSystemAchievement(AcheivementKey key)
 {
     return(key == AcheivementKey.CompleteGame || key == AcheivementKey.Blackjack);
 }