Sign In Register

How can we help you today?

Start a new topic
Answered

How to check if the GameSparks API is ready?

I saw an example mentioned somewhere that you can use the GameSparksAvailable delegate to be told when the API has been initialised.

However no matter what I try, it never seems to be called.
I am using the Unity 5 RC 45 package...

Here is my code below...

void Start()
    {
        GameSparksApi.GameSparksAvailable += HandleGameSparksAvailable;
    }

    private void HandleGameSparksAvailable(object sender, GameSparksAvailabilityEventArgs e)
    {
        Debug.Log("Gamesparks is available!");
    }

 


Best Answer

   

using GameSparks.Core;

// ...
    void Start()
    {
        GS.GameSparksAvailable += HandleGameSparksAvailable;
    }

    void HandleGameSparksAvailable(bool available)
    {
        Debug.Log("available " + available);
    }

   

Works good for me.


Bump, same here.

 

Answer

   

using GameSparks.Core;

// ...
    void Start()
    {
        GS.GameSparksAvailable += HandleGameSparksAvailable;
    }

    void HandleGameSparksAvailable(bool available)
    {
        Debug.Log("available " + available);
    }

   

Works good for me.


1 person likes this