void Start() { PlayGamesPlatform.Activate(); Social.localUser.Authenticate((bool success) => { if (!success) { Debug.Log("Not signed In"); } }); checkach(); //bst.GetComponent<GUIText>().text = ("BEST: " + PlayerPrefs.GetInt ("HIGHSCORE").ToString()); }
private void Start() { if (SceneManager.GetActiveScene().buildIndex == 0) { PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder().Build(); PlayGamesPlatform.InitializeInstance(config); PlayGamesPlatform.DebugLogEnabled = true; PlayGamesPlatform.Activate(); Social.localUser.Authenticate((bool success) => { }); } }
private void Awake() { PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder() .RequestEmail() .RequestIdToken() .Build(); PlayGamesPlatform.InitializeInstance(config); // recommended for debugging: PlayGamesPlatform.DebugLogEnabled = true; // Activate the Google Play Games platform PlayGamesPlatform.Activate(); }
void Awake() { // recommended for debugging: PlayGamesPlatform.DebugLogEnabled = true; // Activate the Google Play Games platform PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder().Build(); PlayGamesPlatform.InitializeInstance(config); PlayGamesPlatform.Activate(); LogInAuto(); AddScoreToLeaderBorad(); }
public void setImageActiveGameOver(bool active) { foreach (Image imgGameOver in GameOverPause) { imgGameOver.gameObject.SetActive(active); if (PlayerPrefs.GetInt("best") < scores) { PlayerPrefs.SetInt("best", scores); } PlayGamesPlatform.Activate(); Social.ReportScore(scores, leaderboard, (bool success) => { }); } }
void Start() { PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder().Build(); PlayGamesPlatform.InitializeInstance(config); // recommended for debugging: PlayGamesPlatform.DebugLogEnabled = true; // Activate the Google Play Games platform PlayGamesPlatform.Activate(); Initialize(); }
private void Start() { PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder() .RequestEmail() .RequestIdToken() .Build(); PlayGamesPlatform.InitializeInstance(config); PlayGamesPlatform.DebugLogEnabled = true; PlayGamesPlatform.Activate(); auth = Firebase.Auth.FirebaseAuth.DefaultInstance; }
private void InitiatePlayGames() { PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder() // enables saving game progress. .EnableSavedGames() .Build(); PlayGamesPlatform.InitializeInstance(config); // recommended for debugging: PlayGamesPlatform.DebugLogEnabled = false; // Activate the Google Play Games platform PlayGamesPlatform.Activate(); }
/* Toma de referencias */ void Awake() { PlayGamesPlatform.Activate(); animatorController = player.GetComponent <AnimationController>(); buttonText = shopMenu.GetComponentsInChildren <Text>()[0]; moneyCounterShop = shopMenu.GetComponentsInChildren <Text>()[1]; skinPriceText = shopMenu.GetComponentsInChildren <Text>()[3]; skinDescriptionText = shopMenu.GetComponentsInChildren <Text>()[4]; skinNameText = shopMenu.GetComponentsInChildren <Text>()[5]; connectBtTxt = connectBt.GetComponentInChildren <Text>(); connectBtImg = connectBt.GetComponentsInChildren <Image>()[1]; }
void Awake() { if (mainManager == null) { mainManager = this; DontDestroyOnLoad(gameObject); PlayGamesPlatform.Activate(); } else { Destroy(gameObject); } }
private void ActivatePlayGamesPlatform() { PlayGamesClientConfiguration config = new PlayGamesClientConfiguration .Builder() .RequestServerAuthCode(false) .RequestIdToken() .RequestEmail() .Build(); PlayGamesPlatform.InitializeInstance(config); PlayGamesPlatform.DebugLogEnabled = true; PlayGamesPlatform.Activate(); }
public SocialAndroid() { #if UNITY_ANDROID config = new PlayGamesClientConfiguration.Builder() .EnableSavedGames() .RequestEmail() .Build(); PlayGamesPlatform.InitializeInstance(config); PlayGamesPlatform.DebugLogEnabled = true; playGamesPlatform = PlayGamesPlatform.Activate(); //LeaderBoard #endif }
void Start() { // Authenticate and register a ProcessAuthentication callback // This call needs to be made before we can proceed to other calls in the Social API PlayGamesPlatform.Activate(); LoginGPGS(); PlayerPrefs.SetInt("user_id_bool", 0); SceneController k = new SceneController(); k.ChangeScene_String("main"); }
public void UpdateStateSucceedsWhenLoggedIn() { var mockClient = new CloudSaveClient(); var platform = new PlayGamesPlatform(mockClient); var listener = new CapturingStateListener(); var data = new byte[] { 0, 1 }; platform.UpdateState(2, data, listener); Assert.AreEqual(2, mockClient.Slot); Assert.AreEqual(data, mockClient.Data); Assert.AreSame(listener, mockClient.Listener); }
void Start() { if (Application.internetReachability == 0) { logText.GetComponentInChildren <UILabel>().text = "Could not connect internet.."; } else { PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder().Build(); PlayGamesPlatform.InitializeInstance(config); PlayGamesPlatform.Activate(); } }
public void ShowLeaderboardUIWorksWhenAuthenticatedAndMappedDefaultLeaderboard() { var mockClient = new LeaderboardClient(); var platform = new PlayGamesPlatform(mockClient); platform.AddIdMapping("unmappedDefault", "mappedDefault"); platform.SetDefaultLeaderboardForUI("unmappedDefault"); platform.ShowLeaderboardUI(); Assert.IsTrue(mockClient.UIShown); Assert.AreEqual("mappedDefault", mockClient.ShownId); }
public void UpdateStateFailsWhenNotLoggedIn() { var mockClient = new CloudSaveClient(); var platform = new PlayGamesPlatform(mockClient); var listener = new CapturingStateListener(); mockClient.Authenticated = false; platform.UpdateState(2, new byte[] { 0, 1 }, listener); Assert.AreEqual(2, listener.SlotForLastOperation); Assert.IsFalse(listener.LastOperationSucceeded.Value); }
public void ReportScoreIsNoOpWhenUnauthenticated() { var mockClient = new LeaderboardClient(); var platform = new PlayGamesPlatform(mockClient); var capturingCallback = new CapturingAction <bool>(); mockClient.Authenticated = false; platform.ReportScore(100, "leaderboard", capturingCallback.invoke); Assert.IsNull(mockClient.SubmittedId); Assert.IsNull(mockClient.SubmittedScore); Assert.IsFalse(capturingCallback.Captured); }
public void ReportScoreIsWorksWhenIdMapped() { var mockClient = new LeaderboardClient(); var platform = new PlayGamesPlatform(mockClient); platform.AddIdMapping("unmappedLeaderboard", "mappedLeaderboard"); platform.ReportScore(300L, "unmappedLeaderboard", SentinelCallback); Assert.AreEqual("mappedLeaderboard", mockClient.SubmittedId); Assert.AreEqual(300L, mockClient.SubmittedScore); Assert.AreSame(SentinelCallback, mockClient.SubmitCallback); }
// Use this for initialization void Start() { #if UNITY_ANDROID // recommended for debugging: PlayGamesPlatform.DebugLogEnabled = true; // Activate the Google Play Games platform PlayGamesPlatform.Activate(); #endif AuthenticateUser(); GetComponent <Button> ().onClick.AddListener(AuthenticateUser); }
public void AchievementIncrementForMappedId() { var mockClient = new AchievementClient(); var platform = new PlayGamesPlatform(mockClient); platform.AddIdMapping("unmapped", "mapped"); platform.IncrementAchievement("unmapped", 30, SentinelCallback); Assert.AreEqual("mapped", mockClient.IncrementedId); Assert.AreEqual(30, mockClient.IncrementedSteps); Assert.AreSame(SentinelCallback, mockClient.IncrementedCallback); }
private void Start() { PlayGamesClientConfiguration configuration = new PlayGamesClientConfiguration.Builder().Build(); PlayGamesPlatform.InitializeInstance(configuration); PlayGamesPlatform.DebugLogEnabled = true; PlayGamesPlatform.Activate(); Social.localUser.Authenticate(succes => { IsAuthenticate = succes; Debug.Log("Social " + succes); }); }
private void InitiatePlayGames() { PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder() .EnableSavedGames() .Build(); PlayGamesPlatform.InitializeInstance(config); // recommended for debugging: PlayGamesPlatform.DebugLogEnabled = true; // Activate the Google Play Games platform PlayGamesPlatform.Activate(); Debug.Log("PlayGamesPlatform Initialized"); }
private void Awake() { PlayGamesPlatform.Activate(); bulletHole.SetActive(false); isPlaying = false; if (!PlayerPrefs.HasKey("Tutorial")) { PlayerPrefs.SetInt("Tutorial", 1); } spawn = spawnPattern.GetComponent <PatternSpawner>(); multiplicador = 1; MenuManager.Instance.UpdatePoints(points, 0, multiplicador); }
private void Awake() { _LoadManager.LoadingScreen(true); if (MenuManager == null) { MenuManager = FindObjectOfType <GoogleMainMenuManager>(); } if (_NoticeManage == null) { _NoticeManage = NoticeManager.SingleTonyStark; } singletonGooglePlay = this; if (!PlayGamesPlatform.Instance.localUser.authenticated) { PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder().Build(); PlayGamesPlatform.InitializeInstance(config); PlayGamesPlatform.Activate(); PlayGamesPlatform.DebugLogEnabled = true; } if (Application.platform == RuntimePlatform.Android) { print("Android"); if (PlayerPrefs.HasKey(GoogleSignInTracking)) { DebugMaster.OnDebugging(" Old player - Account found!"); TestAuthLogin(); } else { DebugMaster.OnDebugging(" New player - No login records found!"); } } //else if (Application.platform == RuntimePlatform.IPhonePlayer) //{ // print("Iphone"); //} //else //{ // print("Editor"); //} }
// Use this for initialization void Start() { // start with unmodified data. mModified = false; //This is the callback that is called when signing in. mAuthCallback = (bool success) => { // When successful - change the text of the sign-in button // and load the auto saved file. if (success) { Debug.Log("Authentication was successful!"); mSignInButton.GetComponentInChildren <Text>().text = "Sign Out"; mMsg = ""; LoadAutoSave(); } else { Debug.LogWarning("Authentication failed!"); mSignInButton.GetComponentInChildren <Text>().text = "Sign In"; } }; // Set the configuration enabling SavedGames API. PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder() .EnableSavedGames() .Build(); PlayGamesPlatform.InitializeInstance(config); // Activate the Play Games platform. This will make it the default // implementation of Social.Active PlayGamesPlatform.Activate(); // enable debug logs (note: we do this because this is a sample; on your production // app, you probably don't want this turned on by default, as it will fill the user's // logs with debug info). PlayGamesPlatform.DebugLogEnabled = true; //Login explicitly for this sample, usually this would be silent PlayGamesPlatform.Instance.Authenticate(mAuthCallback, false); // Initialize the input fields with validation rules. mFloatText.characterValidation = InputField.CharacterValidation.Decimal; mStringText.characterValidation = InputField.CharacterValidation.None; mIntText.characterValidation = InputField.CharacterValidation.Integer; // Set the values of the input fields to their initial values. UpdateDisplay(); }
private void Awake() { #region Saved Data // Если отсутствуют сохранения, устанавливаем значения по умолчанию if (PlayerPrefs.HasKey("saved-data") == false) { // Язык интерфейса игры PlayerPrefs.SetString("current-language", (Application.systemLanguage == SystemLanguage.Russian) ? "ru-RU" : "en-US"); // Настройка звука PlayerPrefs.SetInt("sounds", 0); // Активный набор уровней PlayerPrefs.SetInt("sets", 1); // Звезды за пройденные уровни PlayerPrefs.SetString("stars-level", "{\"Stars\": []}"); // Активный игровой персонаж PlayerPrefs.SetInt("character", 1); // Статистика по персонажам PlayerPrefs.SetString("character-1", "{\"Played\": 0, \"Deaths\": 0}"); PlayerPrefs.SetString("character-2", "{\"Played\": 0, \"Deaths\": 0}"); PlayerPrefs.SetString("character-3", "{\"Played\": 0, \"Deaths\": 0}"); PlayerPrefs.SetString("character-4", "{\"Played\": 0, \"Deaths\": 0}"); PlayerPrefs.SetString("character-5", "{\"Played\": 0, \"Deaths\": 0}"); // Прогресс викторины PlayerPrefs.SetInt("progress", 1); // Общий игровой счет PlayerPrefs.SetInt("score", 0); // Текущее количество монет PlayerPrefs.SetInt("coins", 0); // Общее количество собранных монет PlayerPrefs.SetInt("total-coins", 0); // Общее количество собранных мозгов PlayerPrefs.SetInt("brains", 0); // Общее количество уничтоженных бочек PlayerPrefs.SetInt("barrel", 0); // Позиция игрока в рейтинге PlayerPrefs.SetInt("rank", 0); // Таблица лучших игроков PlayerPrefs.SetString("gp-leaderboard", ""); // Первоначальные сохранения PlayerPrefs.SetString("saved-data", "yes"); } #endregion // Активация игровых сервисов Google Play PlayGamesPlatform.Activate(); }
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(); }
void Awake() { if (gamestate == null) { gamestate = this; DontDestroyOnLoad(gameObject); PlayGamesPlatform.DebugLogEnabled = true; PlayGamesPlatform.Activate(); } else if (gamestate != this) { Destroy(gameObject); } }
// Use this for initialization void Awake() { #if UNITY_ANDROID { if (IsSocialActive) { return; } PlayGamesPlatform.Activate(); PlayGamesPlatform.DebugLogEnabled = true; } #endif }