public void CashPlanetoid(Planetoid toCash) { toCash.gameObject.SetActive(false); if (!_cashedPlanetoids.Contains(toCash)) { _cashedPlanetoids.Add(toCash); _planetoids.Remove(toCash); } PlanetoidLeftPlay.CallOnceAtEndOfFrame(); }
void Start() { #if UNITY_EDITOR //PlayGamesPlatform.DebugLogEnabled = true; #endif PlayGamesPlatform.Activate(); SetupFinished.CallOnceAtEndOfFrame(); }
void Damage(float damage) { if (_gameManager.GameRunning && _health > 0) { _health -= damage; UpdateShieldColor(); if (_health <= 0) { Died.CallOnceAtEndOfFrame(); } } }
void TryAuthenticateGooglePlay(Action successCallback) { Social.localUser.Authenticate((bool success) => { if (success) { GooglePlayAuthenticated.CallOnceAtEndOfFrame(); successCallback(); } else { _notLoggedInIndicator.SetActive(true); } }); }
public void StopGameMode(bool instantly = false) { _gameMode.EndGame(); GameModeEnded.CallOnceAtEndOfFrame(); if (instantly) { _gameMenu.gameObject.SetActive(true); } else { StartCoroutine(DelayShowGameMenu()); } }
public Planetoid GetNewOrCashedPlanetoid() { Planetoid planetoid; if (_cashedPlanetoids.Count > 0) { planetoid = _cashedPlanetoids[0]; planetoid.gameObject.SetActive(true); _cashedPlanetoids.Remove(planetoid); _planetoids.Add(planetoid); } else { GameObject newPlanetoidObject = Instantiate(_planetoidPrefab.gameObject, Vector3.zero, Quaternion.identity) as GameObject; newPlanetoidObject.transform.parent = transform; planetoid = newPlanetoidObject.GetComponent <Planetoid>(); _planetoids.Add(planetoid); } PlanetoidEnteredPlay.CallOnceAtEndOfFrame(); return(planetoid); }