Пример #1
0
        public void StartLeaderboard(bool autoStart = false)
        {
            if (!Network.IsInternetConnection() && !autoStart)
            {
                Core.Utility.Popup.PopupMessages.Me.InternetConnectionMessgae();
                return;
            }
#if UNITY_IOS && GAMECENTER
            if (!GameCenterBinding.isPlayerAuthenticated())
            {
                GameCenterBinding.authenticateLocalPlayer();
            }
#endif
#if UNITY_ANDROID
#if GPGSERVIES && !AMAZONSTORE
            GPGManager.authenticationFailedEvent += (string error) => {
                MyDebug.Log("Prime[31] Google Play service authenticate fail with error:\n" + error);
            };
            GPGManager.authenticationSucceededEvent += (string data) => {
                MyDebug.Log("Prime[31] Google Play service authenticate compelete with data:\n" + data);
            };
            if (!PlayGameServices.isSignedIn())
            {
#if MYDEBUG
                PlayGameServices.enableDebugLog(true);
#endif
                PlayGameServices.authenticate();
            }
#endif
#endif
        }
Пример #2
0
    void Start()
    {
        PlayGameServices.enableDebugLog(true);

        // we always want to call init as soon as possible after launch. Be sure to pass your own clientId to init on iOS!
        // This call is not required on Android.
        //PlayGameServices.init( "YOUR_CLIENT_ID", true );
        PlayGameServices.init("160040154367.apps.googleusercontent.com", true);
    }
Пример #3
0
    // Use this for initialization
    void Start()
    {
                                #if UNITY_ANDROID
        PlayGameServices.enableDebugLog(true);

        // we always want to call init as soon as possible after launch. Be sure to pass your own clientId to init on iOS!
        // This call is not required on Android.
        //PlayGameServices.init( "YOUR_CLIENT_ID", true );
        PlayGameServices.init("366869334068.apps.googleusercontent.com", true);

        PlayGameServices.authenticate();
                                #endif
    }
Пример #4
0
    private void Init()
    {
        string s = MySocialPrime31EventListener.Instance.name;

        PlayGameServices.enableDebugLog(true);
#if UNITY_IPHONE
        // we always want to call init as soon as possible after launch. Be sure to pass your own clientId to init on iOS!
        // This call is not required on Android.
        //PlayGameServices.init("80302069049-5lm6co43b05m3im6usj6c8ccpg7q7570.apps.googleusercontent.com", false);//только для IOS.  Надо вставить clientID
        //PlayGameServices.init("5lm6co43b05m3im6usj6c8ccpg7q7570.apps.googleusercontent.com", false);
        PlayGameServices.init("80302069049.apps.googleusercontent.com", false); //так должно быть судя по этому скрину,  https://developers.google.com/games/services/images/consoleLocationOfClientId2.png
#endif
        //GPGManager.loadScoresSucceededEvent += Instance.loadScoresSucceededEvent;
    }
        public AndroidLeaderboard(string leaderboardId)
        {
#if UNITY_ANDROID
            Debug.Log("Init android leaderboard.");
            _leaderboardId = leaderboardId;

            PlayGameServices.enableDebugLog(true);

            GPGManager.authenticationFailedEvent    += GPGManager_authenticationFailedEvent;
            GPGManager.authenticationSucceededEvent += GPGManager_authenticationSucceededEvent;
            GPGManager.submitScoreFailedEvent       += GPGManager_submitScoreFailedEvent;
            GPGManager.submitScoreSucceededEvent    += GPGManager_submitScoreSucceededEvent;

            Debug.Log("Try silent authentication.");
            //PlayGameServices.attemptSilentAuthentication();
            PlayGameServices.authenticate();
#else
            Debug.Log("Error. AndroidLeaderboard call for not android platform.");
#endif
        }