internal static void OnAchievementsUnlocked(IntPtr address) { OnAchievementsUnlockedCallback callback = null; OnAchievementsUnlockedCallbackInfo callbackInfo = null; if (Helper.TryGetAndRemoveCallback <OnAchievementsUnlockedCallback, OnAchievementsUnlockedCallbackInfoInternal, OnAchievementsUnlockedCallbackInfo>(address, out callback, out callbackInfo)) { callback(callbackInfo); } }
/// <summary> /// DEPRECATED! Use <see cref="AddNotifyAchievementsUnlockedV2" /> instead. /// /// Register to receive achievement unlocked notifications. /// @note must call <see cref="RemoveNotifyAchievementsUnlocked" /> to remove the notification /// <seealso cref="RemoveNotifyAchievementsUnlocked" /> /// </summary> /// <param name="options">Structure containing information about the achievement unlocked notification</param> /// <param name="clientData">Arbitrary data that is passed back to you in the CompletionDelegate</param> /// <param name="notificationFn">A callback that is fired when an achievement unlocked notification for a user has been received</param> /// <returns> /// handle representing the registered callback /// </returns> public ulong AddNotifyAchievementsUnlocked(AddNotifyAchievementsUnlockedOptions options, object clientData, OnAchievementsUnlockedCallback notificationFn) { System.IntPtr optionsAddress = new System.IntPtr(); Helper.TryMarshalSet <AddNotifyAchievementsUnlockedOptionsInternal, AddNotifyAchievementsUnlockedOptions>(ref optionsAddress, options); var clientDataAddress = System.IntPtr.Zero; var notificationFnInternal = new OnAchievementsUnlockedCallbackInternal(OnAchievementsUnlockedCallbackInternalImplementation); Helper.AddCallback(ref clientDataAddress, clientData, notificationFn, notificationFnInternal); var funcResult = EOS_Achievements_AddNotifyAchievementsUnlocked(InnerHandle, optionsAddress, clientDataAddress, notificationFnInternal); Helper.TryMarshalDispose(ref optionsAddress); Helper.TryAssignNotificationIdToCallback(clientDataAddress, funcResult); return(funcResult); }
/// <summary> /// DEPRECATED! Use <see cref="AddNotifyAchievementsUnlockedV2" /> instead. /// /// Register to receive achievement unlocked notifications. /// @note must call <see cref="RemoveNotifyAchievementsUnlocked" /> to remove the notification /// <seealso cref="RemoveNotifyAchievementsUnlocked" /> /// <seealso cref="Achievements" /> /// </summary> /// <param name="options">Structure containing information about the achievement unlocked notification</param> /// <param name="clientData">Arbitrary data that is passed back to you in the CompletionDelegate</param> /// <param name="notificationFn">A callback that is fired when an achievement unlocked notification for a user has been received</param> /// <returns> /// handle representing the registered callback /// </returns> public ulong AddNotifyAchievementsUnlocked(AddNotifyAchievementsUnlockedOptions options, object clientData, OnAchievementsUnlockedCallback notificationFn) { var optionsInternal = Helper.CopyProperties <AddNotifyAchievementsUnlockedOptionsInternal>(options); var notificationFnInternal = new OnAchievementsUnlockedCallbackInternal(OnAchievementsUnlocked); var clientDataAddress = IntPtr.Zero; Helper.AddCallback(ref clientDataAddress, clientData, notificationFn, notificationFnInternal); var funcResult = EOS_Achievements_AddNotifyAchievementsUnlocked(InnerHandle, ref optionsInternal, clientDataAddress, notificationFnInternal); Helper.TryMarshalDispose(ref optionsInternal); Helper.TryAssignNotificationIdToCallback(clientDataAddress, funcResult); var funcResultReturn = Helper.GetDefault <ulong>(); Helper.TryMarshalGet(funcResult, out funcResultReturn); return(funcResultReturn); }