public void SignIn() { Social.Active.localUser.Authenticate((bool success, string err) => { if (success) { GPGSAchievements.UnlockSignInAchievement(); foreach (var btn in signedInBTN) { btn.SetActive(true); } foreach (var btn in signedOutBTN) { btn.SetActive(false); } GPGSSaveGameState.instance.OpenSave(false); PlayerPrefs.SetInt("GPGSSignIn", 1); Debug.Log("Logged in successfully!"); } else { foreach (var btn in signedInBTN) { btn.SetActive(false); } foreach (var btn in signedOutBTN) { btn.SetActive(true); } PlayerPrefs.SetInt("GPGSSignIn", 0); Debug.Log("Failed to login: " + err); } }); }
/* Функция счета очков при удачном попадании в "окно" * Параметры: * obj - шайба которая пролетела через окно */ public void changeCount(GameObject obj) { ++goals; if (obj.transform.position.y > 0) { --downCount; ++upCount; AudioManager.PlaySound(AudioManager.Audio.rise03); GPGSAchievements.updateIncrementalScore(); } else { ++downCount; --upCount; PlayGamesPlatform.Instance.IncrementAchievement(GPGSIds.achievement_is_this_the_end, 1, null); } upCountText.text = upCount.ToString(); downCountText.text = downCount.ToString(); if (downCount > targetCheckers) { checkTargetCheckers = true; } if (upCount == 0 || downCount == 0) { gameOver(); } }
public void AsteroidDestroyed() { score_value += 500; //TODO COUNT ALL ASTEROIDS AND AFTER GAME ADD ALL GPGSAchievements.IncrementAsteroidAchievement(); }