コード例 #1
0
        private static void FetchUserAchievementsCallbackImpl(IntPtr ptr, Result result)
        {
            GCHandle h = GCHandle.FromIntPtr(ptr);
            FetchUserAchievementsHandler callback = (FetchUserAchievementsHandler)h.Target;

            h.Free();
            callback(result);
        }
コード例 #2
0
        /// <summary>
        ///     Loads a stable list of the current user's achievements to iterate over. If the user has any achievements, do your
        ///     iteration within the callback of this function.
        /// </summary>
        /// <param name="callback"></param>
        public void FetchUserAchievements(FetchUserAchievementsHandler callback)
        {
            GCHandle wrapped = GCHandle.Alloc(callback);

            Methods.FetchUserAchievements(methodsPtr, GCHandle.ToIntPtr(wrapped), FetchUserAchievementsCallbackImpl);
        }