public void UnlockAchievement(string achievementId)
        {
            ITask <HuaweiMobileServices.Utils.Void> task = achievementsClient.ReachWithResult(achievementId);

            task.AddOnSuccessListener((result) =>
            {
                Debug.Log("[HMS GAMES] UnlockAchievements SUCCESS");
                OnUnlockAchievementSuccess?.Invoke();
            }).AddOnFailureListener((exception) =>
            {
                Debug.LogError("[HMSAchievementsManager]: UnlockAchievement failed. CauseMessage: " + exception.WrappedCauseMessage + ", ExceptionMessage: " + exception.WrappedExceptionMessage);
                OnUnlockAchievementFailure?.Invoke(exception);
            });
        }
        public void UnlockAchievement(string achievementId)
        {
            ITask <HuaweiMobileServices.Utils.Void> task = achievementsClient.ReachWithResult(achievementId);

            task.AddOnSuccessListener((result) =>
            {
                Debug.Log("[HMS GAMES] UnlockAchievements SUCCESS");
                OnUnlockAchievementSuccess?.Invoke();
            }).AddOnFailureListener((exception) =>
            {
                Debug.Log("[HMS GAMES] UnlockAchievements ERROR");
                OnUnlockAchievementFailure?.Invoke(exception);
            });
        }
Ejemplo n.º 3
0
        public void UnlockAchievement(string key)
        {
            if (!IsAuthenticated())
            {
                Debug.Log(TAG + ": UnlockAchievement is failed! User is not authenticated!");
                return;
            }

            ITask <HuaweiMobileServices.Utils.Void> task = _achievementClient.ReachWithResult(key);

            task.AddOnSuccessListener((result) =>
            {
                Debug.Log(TAG + ":achievements is unlocked successfully for " + key);
            }).AddOnFailureListener((exception) =>
            {
                Debug.Log(TAG + ": UnlockAchievements ERROR: " + exception.WrappedExceptionMessage);
            });
        }