Ejemplo n.º 1
0
 public void Set(AddNotifyAchievementsUnlockedV2Options other)
 {
     if (other != null)
     {
         m_ApiVersion = AchievementsInterface.Addnotifyachievementsunlockedv2ApiLatest;
     }
 }
        /// <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);
        }