public void SetStepsAtLeast(string achievementID, int steps, Action <bool> callback) { if (!IsAuthenticated()) { Logger.e("SetStepsAtLeast can only be called after authentication."); callback?.Invoke(false); } else { Logger.d("SetStepsAtLeast: " + achievementID + ", steps " + steps); achievementID = MapId(achievementID); mClient.SetStepsAtLeast(achievementID, steps, callback); } }
/// <summary> /// Set an achievement to have at least the given number of steps completed. /// Calling this method while the achievement already has more steps than /// the provided value is a no-op. Once the achievement reaches the /// maximum number of steps, the achievement is automatically unlocked, /// and any further mutation operations are ignored. /// </summary> /// <param name='achievementID'> /// The ID of the achievement to increment. This can be a raw Google Play /// Games achievement 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 achievement 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 SetStepsAtLeast(string achievementID, int steps, Action <bool> callback) { if (!IsAuthenticated()) { Logger.e("SetStepsAtLeast can only be called after authentication."); if (callback != null) { callback.Invoke(false); } return; } // map ID, if it's in the dictionary Logger.d("SetStepsAtLeast: " + achievementID + ", steps " + steps); achievementID = MapId(achievementID); mClient.SetStepsAtLeast(achievementID, steps, callback); }