Unity 3.5 Beta is a fantastic gift this Holiday Season! There are so many levels and components to Unity one can barely become proficient before exciting new featurs are added. On that note, I’m using 3.5B to build an IOS game that requires a leaderboard. Through a post on the Forum I was able to find the Social API in the Documents directory. I created a Javascript named Authenticate and pasted the following Social API code. I got this error: (7,12): BCE0019: ‘Authenticate’ is not a member of ‘UnityEngine.Social’.
function Start ()
{
// Authenticate and register a ProcessAuthentication callback
// This call needs to be made before we can proceed to other calls in the Social API
Social.Authenticate( ProcessAuthentication );
}
// This function gets called when Authenticate completes
// Note that if the operation is successful, Social.localUser will contain data from the server.
function ProcessAuthentication( success: boolean)
{
if (success)
{
Debug.Log("Authenticated, checking achievements");
// Request loaded achievements, and register a callback for processing them
Social.LoadAchievements(ProcessLoadedAchievements);
}
else
Debug.Log("Failed to authenticate");
}
// This function gets called when the LoadAchievement call completes
function ProcessLoadedAchievements(cache: Achievement[])
{
if (cache.Length == 0)
Debug.Log("Error: no achievements found");
else
Debug.Log("Got " + cache.Length + " achievements");
}
I have no idea what to do with the API, if it had loaded, but I know it’s not good to start off getting errors right off the bat. I created an empty game object I had planned to
attach the script to but the error killed that approach deader than a door knob. My question then, is can someone give us(the forum showed more 3.5 users with GameCenter questions) a step by step on how to build a simple basic GameCenter Leaderboard using the Social API? I’ve setup ‘GameCenter’ in iTunes Connect. Have loaded the GameCenter Framework in Xcode. Read documentations. I’m all dressed up and ready to go! Help!