public void DownloadMissingBundles(BundleData[] localBundles, System.Action <DownloadMissingBundlesEventData> callback)
    {
        Debug.Log("Refreshing bundles...");

        if (GSpark.GetInstance().IsAuthenticated)
        {
            DownloadBundleListFromServer(localBundles, callback);
        }
        else
        {
            Debug.Log("GameSparks is not authenticated. Authenticating...");

            GSpark.GetInstance().Authenticate((success) =>
            {
                Debug.LogFormat("GameSparks authenticated: {0}", success);

                if (success)
                {
                    DownloadBundleListFromServer(localBundles, callback);
                }
            });
        }
    }
Ejemplo n.º 2
0
    private IEnumerator InitBackend()
    {
        Timeout timeout = new Timeout();

        timeout.Start(5.0f);
        while (!GameSparks.Core.GS.Available && !timeout.IsTimeout)
        {
            yield return(null);
        }

        if (!GameSparks.Core.GS.Available)
        {
            Debug.Log("GameSparks: timeout when waiting for availability.");
            yield break;
        }

        bool authenticationDone = false;

        Debug.Log("GameSparks: authenticating...");

        GSpark.GetInstance().Authenticate((success) =>
        {
            Debug.LogFormat("GamesSpark: authentication: {0}", success);
            authenticationDone = true;
        });

        timeout.Start(5.0f);
        while (!authenticationDone && !timeout.IsTimeout)
        {
            yield return(null);
        }

        if (!GSpark.GetInstance().IsAuthenticated)
        {
            Debug.Log("GameSparks: timeout when authenticating.");
        }
    }