Search Unity

Connecting GameCenter leaderboard

Discussion in 'iOS and tvOS' started by DarkNeo, Nov 15, 2014.

  1. DarkNeo

    DarkNeo

    Joined:
    Apr 27, 2014
    Posts:
    53
    Hi there,

    I am having a little bit of a problem. I purchased this on the unity assets store.

    https://www.assetstore.unity3d.com/en/#!/content/16887

    I have done the setup for gamecenter fine, but now I am trying to tie in my highscores with a leaderboard on iTunes connect. I have already created my leaderboard and I have my leaderboard ID "highscorels "

    I thought I could easily get it to work, what I didn't realize was that my scoring/highscore setup is written in Java and this plug in connects it through C Sharp. So they are having problems trying to talk to each other.
    for the leaderboard I have tried re-writing it for Javascript but every time I think I have the code ready I get this error.

    BCE0017: The best overload for the method 'UnityEngine.Social.ReportScore(long, String, function(boolean): void)' is not compatible with the argument list '(System.Type, String)'.

    Code (JavaScript):
    1. void ReportScore (long score, string leaderboardID) {
    2.         Debug.Log ("Reporting score " + score + " on leaderboard " + leaderboardID);
    3.         Social.ReportScore (score, leaderboardID, success => {
    4.             Debug.Log(success ? "Reported score successfully" : "Failed to report score");
    5.         });
    6.     }


    My code I have been using is from the unity documentation and I have been trying to work it but nothing works. Just wondering if there is an easier way or a javascript plug to get my highscore to connect to my leaderboard easier. It sucks because I am stuck on this last step, after this I am ready to upload my 2nd game!

    If anyone could give me a tip or point me in the right direction that would be sweet. Thanks again :)

     
unityunity