Example #1
0
        private IEnumerator End(bool isFullBattle)
        {
            yield return(new WaitForEndOfFrame());

            if (_isInBattle)
            {
                _isInBattle = false;

                if (isFullBattle)
                {
                    Points += PointsEarned;
                    UiUpdatePoints();

                    if (Setup.AllyShips.Count > 0)
                    {
                        if (PlayGamesPlatform.Instance.IsAuthenticated())
                        {
                            Social.ReportScore(Points, "CgkIoLGG7ZMFEAIQBQ", (bool success) => { });
                        }

                        if (_isFirstBattle)
                        {
                            PlayGamesPlatform.Instance.UnlockAchievement(Setup.Achievements.Beginner, (bool success) => { });
                        }

                        Level++;
                    }
                    UiUpdateLevelText();
                }

                Destroy(Ships.AllyParent);
                Destroy(Ships.EnemyParent);

                Setup.MainMenuStateParent.SetActive(true);
                Setup.GameStateParent.SetActive(false);

                Setup.Stars.Clear();
                Setup.BattleMusic.Stop();

                _isFirstBattle = false;

                _googleAds.RequestInterstitial();

                StartCoroutine(WaitForAd());

                Save();
            }

            yield return(null);
        }
Example #2
0
 public void RequestInterstitial()
 {
     googleAds.RequestInterstitial();
 }