private static void FetchUserAchievementsCallbackImpl(IntPtr ptr, Result result) { GCHandle h = GCHandle.FromIntPtr(ptr); FetchUserAchievementsHandler callback = (FetchUserAchievementsHandler)h.Target; h.Free(); callback(result); }
/// <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); }