void Awake()
 {
     if (Instance == null)
     {
         Instance  = this;
         isLogedIn = false;
         PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder().Build();
         PlayGamesPlatform.InitializeInstance(config);
         PlayGamesPlatform.Activate();
         SignIn();
         DontDestroyOnLoad(gameObject);
     }
     else
     {
         Destroy(gameObject);
     }
 }
Example #2
0
        private void Awake()
        {
            if (!Instance)
            {
                Instance = this;
                PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder()
                                                      .RequestServerAuthCode(false /* Don't force refresh */)
                                                      .Build();

                PlayGamesPlatform.InitializeInstance(config);
                PlayGamesPlatform.Activate();
            }
            else
            {
                Destroy(gameObject);
            }
        }
Example #3
0
 void Start()
 {
     Instance = this;
     DontDestroyOnLoad(this);
     try
     {
         PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder().Build();
         PlayGamesPlatform.InitializeInstance(config);
         PlayGamesPlatform.DebugLogEnabled = true;
         PlayGamesPlatform.Activate();
         Social.localUser.Authenticate((bool success) => { });
     }
     catch (Exception exception)
     {
         Debug.Log(exception);
     }
 }
 // Start is called before the first frame update
 void Start()
 {
     PlayGamesPlatform.InitializeInstance(new PlayGamesClientConfiguration.Builder().Build());
     PlayGamesPlatform.DebugLogEnabled = true;
     PlayGamesPlatform.Activate();
     Social.localUser.Authenticate((bool success) =>
     {
         if (success)
         {
             print("성공");
         }
         else
         {
             print("11");
         }
     });
 }
Example #5
0
 private void Awake()
 {
     PlayGamesPlatform.Activate();
     if (!PlayGamesPlatform.Instance.localUser.authenticated)
     {
         Social.localUser.Authenticate((bool sucess) =>
         {
             OnConnectionResponse(sucess);
         }
                                       );
     }
     else
     {
         StartCoroutine(bon());
         GetLBScore();
     }
 }
Example #6
0
    public static void TrySignIn(System.Action <bool> callback)
    {
        Debug.Log("Entering Login");
#if UNITY_ANDROID
        Debug.Log("Setting up PlayGamePlatform");
        PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder()
                                              .RequestServerAuthCode(false)
                                              .Build();
        Debug.Log("Config: " + config.ToString());
        PlayGamesPlatform.InitializeInstance(config);
        PlayGamesPlatform.DebugLogEnabled = true;
        PlayGamesPlatform.Activate();
        Debug.Log("PlayGamePlatform Activated");
#endif
        Social.localUser.Authenticate(callback);
        Debug.Log("Leaving Login");
    }
Example #7
0
    void Start()
    {
        PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder().Build();

        PlayGamesPlatform.InitializeInstance(config);
        PlayGamesPlatform.Activate();
        Social.localUser.Authenticate((bool success) => {
            if (success)
            {
                Debug.Log(":)");
            }
            else
            {
                Debug.Log(":(");
            }
        });
    }
Example #8
0
        private void Awake()
        {
            PlayGamesClientConfiguration config = new
                                                  PlayGamesClientConfiguration.Builder()
                                                  .Build();

            PlayGamesPlatform.DebugLogEnabled = true;

            PlayGamesPlatform.InitializeInstance(config);
            PlayGamesPlatform.Activate();

            Auth(delegate
            {
                ScoreServicer.LoadRank();
                AchievsServicer.LoadAchievsCounts();
            });
        }
Example #9
0
    private void Authenticate()
    {
        #if !UNITY_EDITOR
        PlayGamesPlatform.Activate();
        #endif

        Social.localUser.Authenticate((success) => {
            if (success)
            {
                Debug.Log("Social autenticated");
            }
            else
            {
                Debug.Log("SOCIAL NOT AUTENTICATED!!!");
            }
        });
    }
Example #10
0
 // Use this for initialization
 void Start()
 {
     PlayGamesPlatform.Activate();
     if (startMenu.activeInHierarchy)
     {
         Debug.Log("Signing in");
         SignIn();
         if (PlayerPrefs.GetInt("SignIn") == 0)
         {
             SignIn();
         }
         else
         {
             signedin = true;
         }
     }
 }
    void AuthenticateUser()
    {
        //	If the user dose not have internet connectivity.
        if (Application.internetReachability == NetworkReachability.NotReachable)
        {
            signInText.text = "Unable to sign into Google Play Services, To use Google Play features please enable your mobile data or wifi.";
            closeButton.SetActive(true);
        }
        //	If the user has internet connectivity. --- could also use (Application.internetReachability != NetworkReachability.NotReachable)
        else if (Application.internetReachability == NetworkReachability.ReachableViaCarrierDataNetwork || Application.internetReachability == NetworkReachability.ReachableViaLocalAreaNetwork)
        {
            PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder().Build();
            PlayGamesPlatform.InitializeInstance(config);
            PlayGamesPlatform.Activate();

            //	Try to authenticate the user (Sign them into GPS).
            Social.localUser.Authenticate((bool success) =>
            {
                //	If the authentication was successfull.
                if (success == true)
                {
                    Debug.Log("Logged into Google Play Games Services");
                    signInText.text = "Sign in successful.";
                    closeButton.SetActive(false);
                    StartCoroutine(LoadMainMenu());
                }
                //  If the authentication failed.
                else if (success == false)
                {
                    Debug.LogError("Unable to sign into Google Play Services");
                    signInText.text  = "Could not sign into Google Play Services";
                    signInText.color = Color.red;                     //<------------------------------------ Not working, why???
                    closeButton.SetActive(false);
                    StartCoroutine(LoadMainMenu());
                }
                //	If the User is already signed in.
                else if (PlayGamesPlatform.Instance.IsAuthenticated())                   //<------------------ Remove me if it breaks everything.
                {
                    Debug.LogError("Unable to sign in, User is already authenticated.");
                    signInText.text = "You are already signed into Google Play Services.";
                    closeButton.SetActive(false);
                    StartCoroutine(LoadMainMenu());
                }
            });
        }
    }
Example #12
0
    void Awake()
    {
        PlayGamesPlatform.Activate();
        PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder().EnableSavedGames().Build();

        PlayGamesPlatform.InitializeInstance(config);
        Social.localUser.Authenticate((bool success) => {
            if (Social.localUser.authenticated == true && Application.internetReachability != NetworkReachability.NotReachable)
            {
                StartCoroutine(LoadAsynchronously());
            }
            else
            {
                loadingProgress.text = "No Internet Connection";
            }
        });
    }
Example #13
0
    private void Awake()
    {
        Instance   = this;
        speedScore = 1;
        UpdateScores();
        movment = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerMovement>();

        beforeStart       = GameObject.FindGameObjectWithTag("BeforeStart");
        highScoreTxt.text = PlayerPrefs.GetInt("highScore").ToString();
        gameMenu.SetActive(true);
        PlayGamesPlatform.Activate();
        LogIn();
        // advertisment

        Advertisement.Initialize("1800265");
        // OnConnectionResponse(PlayGamesPlatform.Instance.localUser.authenticated);
    }
    private void Awake()
    {
        if (_instance == null)
        {
            _instance = this;
        }
        else
        {
            Destroy(gameObject);
            return;
        }

        DontDestroyOnLoad(gameObject);

        PlayGamesPlatform.DebugLogEnabled = true;
        PlayGamesPlatform.Activate();
    }
Example #15
0
 void Awake()
 {
     rutaArchivo           = Application.persistentDataPath + "/datos.dat";
     rutaArchivoAvisoLeido = Application.persistentDataPath + "/leido.dat";
     //	Debug.Log (rutaArchivoAvisoLeido);
     if (estadoJuego == null)
     {
         estadoJuego = this;
         DontDestroyOnLoad(gameObject);
         PlayGamesPlatform.Activate();
         PlayGamesPlatform.DebugLogEnabled = false;             //OJO desactivar al finalizar
     }
     else if (estadoJuego != this)
     {
         Destroy(gameObject);
     }
 }
Example #16
0
    void Start()
    {
        //get the input field
        playerNameBox = GameObject.Find("Player Name");
        playerName    = playerNameBox.GetComponent <InputField> ();
        //loginElement = GameObject.Find ("Login");
        loginButtonText = GetComponentInChildren <Text> ();

        PlayGamesClientConfiguration clientConfig = new PlayGamesClientConfiguration.Builder().Build();

        PlayGamesPlatform.DebugLogEnabled = true;

        PlayGamesPlatform.InitializeInstance(clientConfig);
        PlayGamesPlatform.Activate();

        PlayGamesPlatform.Instance.Authenticate(SignInCallback, true);
    }
Example #17
0
    void Start()
    {
        PlayGamesClientConfiguration config = new PlayGamesClientConfiguration
                                              .Builder()
                                              .RequestServerAuthCode(false)
                                              .RequestEmail()   // 이메일 요청
                                              .RequestIdToken() // 토큰 요청
                                              .Build();

        //커스텀된 정보로 GPGS 초기화
        PlayGamesPlatform.InitializeInstance(config);
        PlayGamesPlatform.DebugLogEnabled = true;

        //GPGS 시작.
        PlayGamesPlatform.Activate();
        //GoogleAuth();
    }
Example #18
0
    // Use this for initialization
    void Awake()
    {
        if (instance != null && instance != this)
        {
            Destroy(gameObject);
        }
        else
        {
            instance = this;
            GameObject.DontDestroyOnLoad(gameObject);
            PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder().Build();
            PlayGamesPlatform.InitializeInstance(config);
            PlayGamesPlatform.Activate();
        }

        SignIn();
    }
Example #19
0
    public void Auth()
    {
        PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder().Build();

        PlayGamesPlatform.InitializeInstance(config);
        PlayGamesPlatform.Activate();

        Social.localUser.Authenticate((bool success) =>
        {
            if (success == true)
            {
            }
            else
            {
            }
        });
    }
Example #20
0
    // Use this for initialization
    void Start()
    {
        Application.targetFrameRate = 60;
        PlayerPrefs.EnableEncryption(true);
        Instance.isTutorial = PlayerPrefs.GetBool(Constants.TUTORIAL, true);
        Instance.bestScore  = PlayerPrefs.GetInt(Constants.BEST_SCORE, 0);
        Instance.starsCnt   = PlayerPrefs.GetInt(Constants.STAR_TOTAL, 0);
        Instance.totalGames = PlayerPrefs.GetInt(Constants.GAME_COUNT, 0);
        Instance.playerID   = PlayerPrefs.GetInt(Constants.PLAYER_ID, 0);
        Instance.isSound    = PlayerPrefs.GetBool(Constants.SOUND, true);
        Instance.isNoads    = PlayerPrefs.GetBool(Constants.NO_ADS, false);
        Instance.isFBLiked  = PlayerPrefs.GetBool(Constants.FB_LIKE, false);

        audioSource = transform.GetComponent <AudioSource>();
                #if UNITY_ANDROID
        PlayGamesPlatform.Activate();
        EtceteraAndroid.cancelNotification(Constants.H4);
        EtceteraAndroid.cancelNotification(Constants.H8);
        EtceteraAndroid.cancelNotification(Constants.D1);
        EtceteraAndroid.cancelNotification(Constants.D3);
        EtceteraAndroid.cancelNotification(Constants.D7);
        EtceteraAndroid.cancelNotification(Constants.D14);
        EtceteraAndroid.cancelNotification(Constants.D30);
        var key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA19JDG1hIuDeEDYaOxZyqYlv4OgX5+7+/+AcTRNMMhImND9UZsa2Ymh7xzQVUPYlyXOVSBW3RbenhZXWJPA3ZXZvk68hMACGIWGe2ZEFZqYiSELnk1C4XmKeTReC8Z5Y/NgSpSyzI++rvsSuA4j3Xe6SL3lbGUa+eOzmi42yJFU91zWdje6nA2XQFmMk6KqyaRT4Dwh2ntssPP0mQl6JiwJ8nSfp8JodIepYndBgNQ/OLBcko5ktFl1fIzqHJU0ZP6K7kF6i+vPe8H5M3Oal2Mw15/zfLIN+nE1R2IbauOQS7DmCKrMxTqPjUbajbOXJ4An77IhtwSrMkksDjet3/2wIDAQAB";
        GoogleIAB.init(key);
                #elif UNITY_IOS
        UnityEngine.iOS.NotificationServices.RegisterForNotifications(UnityEngine.iOS.NotificationType.Alert | UnityEngine.iOS.NotificationType.Badge);

        UnityEngine.iOS.NotificationServices.ClearLocalNotifications();
        UnityEngine.iOS.NotificationServices.CancelAllLocalNotifications();

        // clear badge number
        UnityEngine.iOS.LocalNotification temp = new UnityEngine.iOS.LocalNotification();
        temp.fireDate = DateTime.Now;
        temp.applicationIconBadgeNumber = -1;
        temp.alertBody = "";
        UnityEngine.iOS.NotificationServices.ScheduleLocalNotification(temp);
                #endif

        //Initialize Heyzap
        HeyzapAds.Start("790edd987b2facf1eb7117dfc97d354b", HeyzapAds.FLAG_NO_OPTIONS);

        Invoke("SignIn", 0.5f);
        Invoke("Play", splashHoldTime);
        DontDestroyOnLoad(gameObject);
    }
Example #21
0
    private void Start()
    {
        CurrentState = GameState.MainMenu;
        MainMenuController.I.ShowMainMenu(true);

        // Create client configuration
        PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder().Build();

        // Enable debugging output (recommended)
        PlayGamesPlatform.DebugLogEnabled = true;

        // Initialize and activate the platform
        PlayGamesPlatform.InitializeInstance(config);
        PlayGamesPlatform.Activate();

        DoLogin();
    }
Example #22
0
    void Start()
    {
        PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder().Build();

        PlayGamesPlatform.InitializeInstance(config);
        PlayGamesPlatform.Activate();
        Social.localUser.Authenticate((bool success) => {
            if (Social.localUser.authenticated == true)
            {
                StartCoroutine(LoadAsynchronously(GroveSceneIndex));
            }
            else
            {
                LoadingProgress.text = "No Internet Connection";
            }
        });
    }
Example #23
0
    public void OnClickGoogle()
    {
        PlayGamesClientConfiguration config = new PlayGamesClientConfiguration
                                              .Builder()
                                              .RequestServerAuthCode(false)
                                              .RequestEmail()   // 이메일 요청
                                              .RequestIdToken() // 토큰 요청
                                              .Build();

        //커스텀된 정보로 GPGS 초기화
        PlayGamesPlatform.InitializeInstance(config);
        PlayGamesPlatform.DebugLogEnabled = false;

        //GPGS 시작.
        PlayGamesPlatform.Activate();
        GoogleAuth(() => { lobbyLoding.Loading(); });
    }
Example #24
0
    private void GPGSInit()
    {
        PlayGamesClientConfiguration config = new PlayGamesClientConfiguration
                                              .Builder()
                                              .RequestServerAuthCode(true)
                                              .RequestEmail()
                                              .RequestIdToken()
                                              .Build();

        PlayGamesPlatform.InitializeInstance(config);
        PlayGamesPlatform.DebugLogEnabled = true;

        //GPGS START
        PlayGamesPlatform.Activate();

        text.text = "no Login";
    }
Example #25
0
        private void Start()
        {
            var config = new PlayGamesClientConfiguration.Builder().Build();

            PlayGamesPlatform.InitializeInstance(config);
            PlayGamesPlatform.Activate();

            Social.localUser.Authenticate(sucess => {
                isReady = sucess;
            });

            InterfaceSign.Instance.OnSignOut += InstanceHandle;

            #if UNITY_EDITOR
            isReady = true;
            #endif
        }
Example #26
0
        private void Start()
        {
            _signInInfoWindow = _modalWindowManager.DisplayInfoWindow("Connecting...",
                                                                      "Connecting to google play services...");
            PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder()
                                                  .EnableSavedGames()
                                                  .RequestEmail()
                                                  .RequestServerAuthCode(false)
                                                  .RequestIdToken()
                                                  .Build();

            PlayGamesPlatform.InitializeInstance(config);
            PlayGamesPlatform.DebugLogEnabled = true;
            PlayGamesPlatform.Activate();

            Social.localUser.Authenticate(AuthenticatedCallback);
        }
Example #27
0
    void Awake()
    {
        rutaArchivo = Application.persistentDataPath + "/datos.dat";

        if (estado == null)
        {
            estado = this;
            DontDestroyOnLoad(gameObject);

            PlayGamesPlatform.DebugLogEnabled = false;
            PlayGamesPlatform.Activate();
        }
        else if (estado != null)
        {
            Destroy(gameObject);
        }
    }
Example #28
0
 // Pause
 public void pauseGame()
 {
     if (Time.timeScale == 1)
     {
         Time.timeScale = 0;
         pauseBtnOn.SetActive(true);
         setImageActive(true);
         PlayGamesPlatform.Activate();
         Social.ReportScore(scores, leaderboard, (bool success) => { });
     }
     else if (Time.timeScale == 0)
     {
         Time.timeScale = 1;
         pauseBtnOn.SetActive(false);
         setImageActive(false);
     }
 }
Example #29
0
        /// <summary>
        /// Google Play SDK 初始化
        /// </summary>
        /// <param name="initData">初始化参数</param>
        /// <param name="callback">初始化成功回调</param>
        public void InitializeSDK(object initData, Action <string, bool> callback)
        {
            EB.Debug.Log("GoogleSDKManager.InitializeSDK");
            clientConfig = new PlayGamesClientConfiguration.Builder().RequestServerAuthCode(false).RequestIdToken()
                           .Build();
            PlayGamesPlatform.InitializeInstance(clientConfig);
            PlayGamesPlatform.DebugLogEnabled = true;
            PlayGamesPlatform.Activate();

            //
            callback(null, true);

            mInitialized        = true;
            Hub.RunInBackground = false;
            mGoogleStore        = new GameObject("Google_SDK_listener").AddComponent <SparxGoogleSDKManagerMono>();
            EB.Debug.Log("GoogleSDKManager.InitializeSDK End");
        }
    //public Text authStatus;
    // Start is called before the first frame update
    void Start()
    {
        // Create client configuration
        PlayGamesClientConfiguration config = new
                                              PlayGamesClientConfiguration.Builder()
                                              .Build();

        // Enable debugging output (recommended)
        PlayGamesPlatform.DebugLogEnabled = true;

        // Initialize and activate the platform
        PlayGamesPlatform.InitializeInstance(config);
        PlayGamesPlatform.Activate();
        //UpdateSignedInUI(false);
        moreItemsObject.SetActive(false);
        PlayGamesPlatform.Instance.Authenticate(SignInCallback, false);
    }