SHARE
TWEET

Game Center Unity 5 Fix

ChestnutGames Sep 16th, 2015 78 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. extern "C" {    
  2.     void _ReportAchievementProgress(const char *achievementID, float progress, bool showsCompletionBanner) {
  3.        
  4.         GKAchievement *achievement = [[GKAchievement alloc] initWithIdentifier:[NSString stringWithUTF8String:achievementID]];
  5.         achievement.percentComplete = progress;
  6.         achievement.showsCompletionBanner = showsCompletionBanner;
  7.        
  8.         [GKAchievement reportAchievements:@[achievement] withCompletionHandler:^(NSError *error) {
  9.             if(error != nil) {
  10.                 NSLog(@"Error reporting achievement: %@", error.localizedDescription);
  11.             }
  12.         }];
  13.     }
  14. }
RAW Paste Data
Top