コード例 #1
0
 public static PXR_Request <PXR_AchievementUpdate> Init()
 {
     if (PXR_AchievementCore.IsInitialized())
     {
         return(new PXR_Request <PXR_AchievementUpdate>(PXR_AchievementAPI.Init()));
     }
     return(null);
 }
コード例 #2
0
        /// Request the achievement definitions that match the specified names.
        ///
        public static PXR_Request <PXR_AchievementDefinitionList> GetDefinitionsByName(string[] names)
        {
            if (PXR_AchievementCore.IsInitialized())
            {
                return(new PXR_Request <PXR_AchievementDefinitionList>(PXR_AchievementAPI.pvr_Achievements_GetDefinitionsByName(names, (names != null ? names.Length : 0))));
            }

            return(null);
        }
コード例 #3
0
        /// Request the progress for the user on all achievements in the app.
        ///
        public static PXR_Request <PXR_AchievementProgressList> GetAllProgress()
        {
            if (PXR_AchievementCore.IsInitialized())
            {
                return(new PXR_Request <PXR_AchievementProgressList>(PXR_AchievementAPI.pvr_Achievements_GetAllProgress()));
            }

            return(null);
        }
コード例 #4
0
        /// Unlock fields of a BITFIELD achievement.
        /// \param name The name of the achievement to unlock
        /// \param fields A string containing either '0' or '1' characters. Every '1' will unlock the field in the corresponding position.
        ///
        public static PXR_Request <PXR_AchievementUpdate> AddFields(string name, string fields)
        {
            if (PXR_AchievementCore.IsInitialized())
            {
                return(new PXR_Request <PXR_AchievementUpdate>(PXR_AchievementAPI.pvr_Achievements_AddFields(name, fields)));
            }

            return(null);
        }
コード例 #5
0
        /*Add 'count' to the achievement with the given name. This must be a COUNT
         * achievement. The largest number that is supported by this method is the max
         * value of a signed 64-bit integer. If the number is larger than that, it is
         * clamped to that max value before being passed to the servers.
         */
        public static PXR_Request <PXR_AchievementUpdate> AddCount(string name, long count)
        {
            if (PXR_AchievementCore.IsInitialized())
            {
                return(new PXR_Request <PXR_AchievementUpdate>(PXR_AchievementAPI.pvr_Achievements_AddCount(name, count)));
            }

            return(null);
        }
コード例 #6
0
        /// Unlock the achievement with the given name. This can be of any achievement
        /// type.
        ///
        public static PXR_Request <PXR_AchievementUpdate> Unlock(string name)
        {
            if (PXR_AchievementCore.IsInitialized())
            {
                return(new PXR_Request <PXR_AchievementUpdate>(PXR_AchievementAPI.pvr_Achievements_Unlock(name)));
            }

            return(null);
        }
コード例 #7
0
        /// <summary>
        /// Get all definitions of achievements.
        /// </summary>
        /// <returns></returns>
        public static PXR_Request <PXR_AchievementDefinitionList> GetAllDefinitions()
        {
            if (PXR_AchievementCore.IsInitialized())
            {
                return(new PXR_Request <PXR_AchievementDefinitionList>(PXR_AchievementAPI.UPxr_AchievementsGetAllDefinitions()));
            }

            return(null);
        }
コード例 #8
0
        /// <summary>
        /// Get achievement progress by name.
        /// </summary>
        /// <param name="names"></param>
        /// <returns></returns>
        public static PXR_Request <PXR_AchievementProgressList> GetProgressByName(string[] names)
        {
            if (PXR_AchievementCore.IsInitialized())
            {
                return(new PXR_Request <PXR_AchievementProgressList>(PXR_AchievementAPI.UPxr_AchievementsGetProgressByName(names, (names != null ? names.Length : 0))));
            }

            return(null);
        }
コード例 #9
0
        public static PXR_Request <PXR_AchievementProgressList> GetNextAchievementProgressListPage(PXR_AchievementProgressList list)
        {
            if (!list.HasNextPage)
            {
                Debug.LogWarning("Platform.GetNextAchievementProgressListPage: List has no next page");
                return(null);
            }

            if (PXR_AchievementCore.IsInitialized())
            {
                return(new PXR_Request <PXR_AchievementProgressList>(
                           PXR_AchievementAPI.pvr_HTTP_GetWithMessageType(
                               list.NextUrl,
                               PXR_Message.MessageType.Achievements_GetNextAchievementProgressArrayPage
                               )
                           ));
            }

            return(null);
        }