How to start with prime31 Game Center plugin?

I have purchased the Game Center plugin from prime31 today. But i cant found out how to use it. I only use JavaScript.

Is it right that i have to add the GameCenterEventListener and GameCenterManager prefabs to every scene i want to use something of the Game Center?

In my start scene i have a Leaderboard button and i want to simply open the Leaderboard that i have created in iTunes Connect with it. In my end scene i want to submit the best score that is saved as a PlayerPrefs every time the game is over.

Can someone help to start?

@arar, the best thing to do is checkout the demo scene included with the plugin. It demos everything the plugin can do all in one place. From the sounds of it all you will need to do is:

  • stick a GameCenterManager prefab in the first scene of your game
  • call GameCenterBinding.reportScore whenever you want to submit a score

Thank you for your answer Prime31. I have now the GameCenterManager prefab added to my start scene. and i call the Leaderboard with this:

	if (GUI.Button (guiposition, "LEADERBOARD", mystyle2)){
		GameCenterBinding.showLeaderboardWithTimeScope( GameCenterLeaderboardTimeScope.AllTime );
	}

But the name of the Leaderboard is not the same like the one in my iTunes Connect. Is this just right when its released?

In my end scene i have this to post the best score:

function Start(){
	GameCenterBinding.reportScore( PlayerPrefs.GetInt("highscore"), leaderboards[0].categoryId );
}

But i got this error. Unknown identifier : leaderboards. What i have to put in this second part of reportScore?

@arar, your second block should have the actual leaderboard ID from iTunes Connect. Something like:

function Start(){
	GameCenterBinding.reportScore( PlayerPrefs.GetInt("highscore"), "yourLeaderboardID" );
}

All of your leaderboard names and data come straight form Apple’s servers so if they are not showing up correctly you may want to: wait 24 hours for Apple’s servers to update and then contact them if they are still not correct.

Prime, I’m impressed with your responsiveness. Your Game Center Plugin is on my list of things to buy soon, but I’ve been working on the core gameplay and cleaning up some stuff. I’d rather integrate into a clean project or right from the start instead of during a cleaning phase.

Thank you very much for your help! I cant believe, this is all? Crazy!

My deployment target is 4.0 but Game Center needs 4.1. Is this a problem? Have i something to do to prevent older iOS to use this stuff?

@arar, you should be building against 4.3 these days. You won’t be able to use GameCenter building against 4.0.

P31, I hear that 4.3 apps are being rejected. Sadly, that is what I am using.

@JRavey, those days are over. Unity released a fix. If you search the forum you will find the small change you need to make to your Xcode project to get it working.

@prime31 i dont know if i can set the deployment target to 4.3 for my update if my first version was for 4.0?

It shows now the Leaderboard. But it says No Scores. I dont know what is wrong. Need it some time before the scores are showing up?

@arar, you absolutely can change your deployment target. Apple recommends always having your deployment target set to the latest version of iOS.

@Prime31 Sorry for so many questions! I have set my build to debug and logged out of the Game Center. But when it shows the Leaderboard it shows no scores. Is there a other way to look if a score is submitted. Or can this just done if someone is logged in? How can i test if everything is ok?

@arar, the sandbox servers are often very slow to update. Sometimes just giving it some time does the trick. Also, deleting the game entirely form your device between tests is usually a good idea as well until everything is working properly. That will clear out the caches.

i can not bring it to work. have i to add a new version in iTunes Connect and activate the Game Center for this version that i can test the Game Center?

@arar, you need your app to have Game Center activated in iTunes Connect and all your leaderboards/achievements setup. You also should be using test users and you must always use debug builds.

In the overview of my app in iTunes Connect i have enabled Game Center and created a Leaderboard under “Manage Game Center”. But have i also to add a new version for my app and activate Game Center for this new version that i am currently testing?

@arar, you have to use an unreleased version of your app for testing in the sandbox server so add a new version and use a debug build in Xcode.

I feel really stupid now.

I have set up the Leaderboard in iTunes Connect and created a new version for my app. In this new version i have enabled the Game Center and it shows the name of the Leaderboard correct. In my Unity project i have changed the version number and i have added the GameCenterManager prefab to the start scene. i display the Leaderboard with this:

if (GUI.Button (guiposition, "LEADERBOARD", mystyle2)){
		GameCenterBinding.showLeaderboardWithTimeScope( GameCenterLeaderboardTimeScope.AllTime );
	}

In my end scene i submit the score with this:

function Start(){
GameCenterBinding.reportScore( PlayerPrefs.GetInt("highscore"), "JumpfastLeaderboard");
}

I have set to debug build in Xcode and set the deployment target to 4.1. On my iPod touch i have logged out my normal account.

It shows a Leaderboard but there are no scores in there.

@arar, add the GameCenterEventListener prefab to your scene and watch the Xcode console. It will dump any successful or unsuccessful reportScore attempts in there so you can pinpoint the issue.

ok.

reportScoreFailed: JumpfastLeaderboard

(Filename: /Applications/buildAgent/work/6bc5f79e0a4296d6/Projects/…/Runtime/Export/Generated/BaseClass.cpp Line: 2505)

any idea?