コード例 #1
0
 public void Authenticate(ILocalUser user, Action <bool, string> callback)
 {
     authenticationCallback = b => {
         callback.Invoke(b, string.Empty);
     };
     AGSClient.Init(/*Leaderboards*/ true, /*Achievements*/ true, /*Whispersync*/ false);
 }
コード例 #2
0
 /// <summary>
 /// Authenticate the specified user and callback.
 /// </summary>
 /// <param name='user'>
 /// User.
 /// </param>
 /// <param name='callback'>
 /// Callback.
 /// </param>
 public void Authenticate(ILocalUser user, System.Action <bool> callback)
 {
     // Forward the AGSClient callbacks to the passed in callback.
     authenticationCallback = callback;
     // If using GameCircle with the Unity Social API,
     // initialize it with leaderboards and achievements, but not whispersync.
     AGSClient.Init(/*Leaderboards*/ true, /*Achievements*/ true, /*Whispersync*/ false);
 }
コード例 #3
0
    //--------------------------------------
    // PRIVATE API CALL METHODS
    //--------------------------------------

    private void Init()
    {
        _isInitialized = true;

                #if AMAZON_CIRCLE_ENABLED
        AGSClient.Init(true, true, true);
                #endif
    }
コード例 #4
0
    /// <summary>
    /// Initializes the GameCircle plugin.
    /// </summary>
    void InitializeGameCircle()
    {
        // Step the initialization progress forward.

        // Subscribe to the initialization events so the menu knows when GameCircle is ready (or errors out)
        SubscribeToGameCircleInitializationEvents();
        bool usesLeaderboards = true;
        bool usesAchievements = false;
        bool usesWhispersync  = false;

        // Begin GameCircle initialization.
        AGSClient.Init(usesLeaderboards, usesAchievements, usesWhispersync);
    }
コード例 #5
0
 /// <summary>
 /// Authenticate the specified user and callback.
 /// </summary>
 /// <param name='user'>
 /// User.
 /// </param>
 /// <param name='callback'>
 /// Callback.
 /// </param>
 public void Authenticate(ILocalUser user, System.Action <bool> callback)
 {
     // Forward the AGSClient callbacks to the passed in callback.
     if (null != callback)
     {
         AGSClient.ServiceReadyEvent += () => {
             callback(true);
         };
         AGSClient.ServiceNotReadyEvent += (error) => { callback(false); };
     }
     // If using GameCircle with the Unity Social API,
     // initialize it with leaderboards and achievements, but not whispersync.
     AGSClient.Init(/*Leaderboards*/ true, /*Achievements*/ true, /*Whispersync*/ false);
 }
    /// <summary>
    /// Initializes the GameCircle plugin.
    /// </summary>
    void InitializeGameCircle()
    {
        // Step the initialization progress forward.
        initializationStatus = EInitializationStatus.InitializationRequested;

        // Subscribe to the initialization events so the menu knows when GameCircle is ready (or errors out)
        SubscribeToGameCircleInitializationEvents();

        // Start a timer to help show this is an asynchronous event.
        initRequestTime = System.DateTime.Now;

        // Begin GameCircle initialization.
        AGSClient.Init(usesLeaderboards, usesAchievements, usesWhispersync);
    }
コード例 #7
0
    void InitializeGameCircle()
    {
        //Revisar si service readu
        if (AGSClient.IsServiceReady())
        {
            return;
        }
        // Step the initialization progress forward.
        initializationStatus = EInitializationStatus.InitializationRequested;


        SubscribeToGameCircleInitializationEvents();
        //  SubscribeToSubmitAchievementEvents();

        // Begin GameCircle initialization.
        Debug.Log("Llamando a Init GameCircle");
        AGSClient.Init(usesLeaderboards, usesAchievements, usesWhispersync);
    }
コード例 #8
0
        /// <summary>
        /// Initializes Amazon GameCircle.
        /// </summary>
        /// <param name="activateCloudSave">Whether or not Cloud Saving should be activated.</param>
        /// <param name="autoSignIn">
        /// Ignored on Amazon GameCircle as there is no way of avoiding auto sign in.
        /// </param>
        /// <param name="autoCloudLoad">
        /// Whether or not cloud data should be loaded automatically if the user is successfully signed in.
        /// Ignored if Cloud Saving is deactivated or the user fails to sign in.
        /// </param>
        public override void Initialize(bool activateCloudSave = true, bool autoSignIn = true, bool autoCloudLoad = true)
        {
            if (isInitializing)
            {
                return;
            }

            isInitializing          = true;
            cloudSaveEnabled        = activateCloudSave;
            autoLoadOnSignInEnabled = autoCloudLoad;
#if CLOUDONCE_DEBUG
            Debug.Log("Initializing Amazon GameCircle.");
            Debug.Log(activateCloudSave ? "WhisperSync support enabled." : "WhisperSync support disabled.");
            AGSClient.errorLevel = AmazonLogging.AmazonLoggingLevel.Verbose;
#endif
            SubscribeEvents(autoCloudLoad);
            AGSClient.Init(true, true, activateCloudSave);
        }
コード例 #9
0
        /// <summary>
        /// Called by Unity when the application loses or regains focus.
        /// </summary>
        /// <param name="focusStatus"><c>true</c> if the application has regained focus.
        /// <c>false</c> if it has lost focus.</param>
        private void OnApplicationFocus(bool focusStatus)
        {
            if (!firstInitializedFinished || !AGSClient.ReinitializeOnFocus)
            {
                return;
            }

            if (focusStatus)
            {
#if CLOUDONCE_DEBUG
                Debug.Log("AmazonCloudProvider.OnApplicationFocus(true) -> AGSClient.Init()");
#endif
                AGSClient.Init();
            }
            else
            {
#if CLOUDONCE_DEBUG
                Debug.Log("AmazonCloudProvider.OnApplicationFocus(false) -> AGSClient.release()");
#endif
                AGSClient.release();
            }
        }
コード例 #10
0
    // Use this for initialization

    void Start()
    {
        return;

                #if UNITY_ANDROID
        if (UserPrefs.isAmazonBuild)
        {
            bool isServiceReady = AGSClient.IsServiceReady();

            if (!isServiceReady)
            {
                AGSClient.ServiceReadyEvent    += serviceReadyHandler;
                AGSClient.ServiceNotReadyEvent += serviceNotReadyHandler;

                AGSClient.Init(true, true, false);                 //usesLeaderboards, usesAchievements, usesWhispersync
            }
        }
                #endif
#if UNITY_IPHONE
        GameCenterBinding.authenticateLocalPlayer();
#endif
    }