/// <summary>
        /// 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 AddNotifyAchievementsUnlockedV2(AddNotifyAchievementsUnlockedV2Options options, object clientData, OnAchievementsUnlockedCallbackV2 notificationFn)
        {
            System.IntPtr optionsAddress = new System.IntPtr();
            Helper.TryMarshalSet <AddNotifyAchievementsUnlockedV2OptionsInternal, AddNotifyAchievementsUnlockedV2Options>(ref optionsAddress, options);

            var clientDataAddress = System.IntPtr.Zero;

            var notificationFnInternal = new OnAchievementsUnlockedCallbackV2Internal(OnAchievementsUnlockedCallbackV2InternalImplementation);

            Helper.AddCallback(ref clientDataAddress, clientData, notificationFn, notificationFnInternal);

            var funcResult = EOS_Achievements_AddNotifyAchievementsUnlockedV2(InnerHandle, optionsAddress, clientDataAddress, notificationFnInternal);

            Helper.TryMarshalDispose(ref optionsAddress);

            Helper.TryAssignNotificationIdToCallback(clientDataAddress, funcResult);

            return(funcResult);
        }
Example #2
0
        /// <summary>
        /// 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 AddNotifyAchievementsUnlockedV2(AddNotifyAchievementsUnlockedV2Options options, object clientData, OnAchievementsUnlockedCallbackV2 notificationFn)
        {
            var optionsInternal = Helper.CopyProperties <AddNotifyAchievementsUnlockedV2OptionsInternal>(options);

            var notificationFnInternal = new OnAchievementsUnlockedCallbackV2Internal(OnAchievementsUnlockedV2);
            var clientDataAddress      = IntPtr.Zero;

            Helper.AddCallback(ref clientDataAddress, clientData, notificationFn, notificationFnInternal);

            var funcResult = EOS_Achievements_AddNotifyAchievementsUnlockedV2(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);
        }
 internal static extern ulong EOS_Achievements_AddNotifyAchievementsUnlockedV2(System.IntPtr handle, System.IntPtr options, System.IntPtr clientData, OnAchievementsUnlockedCallbackV2Internal notificationFn);
Example #4
0
 private static extern ulong EOS_Achievements_AddNotifyAchievementsUnlockedV2(IntPtr handle, ref AddNotifyAchievementsUnlockedV2OptionsInternal options, IntPtr clientData, OnAchievementsUnlockedCallbackV2Internal notificationFn);