خرید بک لینک

Vote count: 0

In the Gamejolt API Documentation

The trophy.Unlocked in

C#

var trophyID = 26534;
GameJolt.API.Trophies.Get(trophyID, (GameJolt.API.Objects.Trophy trophy) => {
    if (trophy != null)
    {
        Debug.Log(string.Format("> {0} - {1} - {2} - {3}Unlocked", trophy.Title, trophy.ID, trophy.Difficulty, trophy.Unlocked ? "" : "Not "));
    }
});

...works fine. But that was C#. I'm using Javascript and my trophy.Unlocked:

JAVASCRIPT

var trophyID = 26534;
GameJolt.API.Trophies.Get(trophyID, function(trophy) {
    if (trophy.Unlocked != null) {
        GameJolt.API.Trophies.Unlock(trophyID, null);
        StopBeen = false;
    }
});

..caot be recognised. I know I haven't translated from C# to Javascript properly. So can someone explain what this line:

GameJolt.API.Trophies.Get(trophyID, (GameJolt.API.Objects.Trophy trophy) => {

even does (and what's the Javascript equivalent) and why a function call has a function inside it which has other code.

This seems like it could help me, but I caot understand it much.

asked 32 secs ago

برچسب: نویسنده: استخدام کار تاريخ: چهارشنبه 25 فروردين 1395 ساعت: 8:38

صفحه بندی