コード例 #1
0
        /// <summary>
        /// Increments an event. This is unique to the Play Games.
        /// </summary>
        /// <param name='eventID'>
        /// The ID of the event to increment. This can be a raw Google Play
        /// Games event ID (alphanumeric string), or an alias that was previously configured
        /// by a call to <see cref="AddIdMapping" />.
        /// </param>
        /// <param name='steps'>
        /// The number of steps to increment the event by.
        /// </param>
        /// <param name='callback'>
        /// The callback to call to report the success or failure of the operation. The callback
        /// will be called with <c>true</c> to indicate success or <c>false</c> for failure.
        /// </param>
        public void IncrementEvent(string eventID, int steps, Action <bool> callback)
        {
            if (!IsAuthenticated())
            {
                Logger.e("IncrementEvent can only be called after authentication.");
                if (callback != null)
                {
                    callback.Invoke(false);
                }
                return;
            }


            // map ID, if it's in the dictionary
            Logger.d("IncrementEvent: " + eventID + ", steps " + steps);
            eventID = MapId(eventID);
            mClient.IncrementEvent(eventID, steps, callback);
        }