Example #1
0
        private IEnumerator ShowGameOverRoutine()
        {
            Balls.Active = false;
            OverallRankLoading.SetActive(false);
            DailyRankLoading.SetActive(false);
            WeeklyRankLoading.SetActive(false);
            UIManager.Gameplay.Hide();
            MenuBtn.transform.position    = new Vector3(-400f, -150f, 0f) * GameManager.NGUI_SCALE;
            RestartBtn.transform.position = new Vector3(400f, -150f, 0f) * GameManager.NGUI_SCALE;
            ShareBtn.transform.position   = new Vector3(0f, -500f, 0f) * GameManager.NGUI_SCALE;
            yield return(new WaitForEndOfFrame());

            yield return(StartCoroutine(ShowRanksRoutine()));

            //  if (Balls.Score > GameData.DailyBest)
            {
                OverallRankLoading.SetActive(true);
                DailyRankLoading.SetActive(true);
                WeeklyRankLoading.SetActive(true);
                PlayGameServiceManager.ReportScore(Balls.Score);
            }
            yield return(new WaitForEndOfFrame());

            ScoreText.text     = string.Format("{0}", Balls.Score);
            BestScoreText.text = string.Format("{0}", GameData.OverallBest);
            yield return(new WaitForEndOfFrame());

            if (Balls.Score > GameData.OverallBest)
            {
                GameData.OverallBest = Balls.Score;
                yield return(new WaitForSecondsRealtime(0.5f));

                BestScoreText.text = string.Format("{0}", GameData.OverallBest);
                yield return(new WaitForSecondsRealtime(0.5f));

                NewBestStamp.SetActive(true);
                NewBestStamp.ScaleTo(Vector3.one, 0.5f, 0f, EaseType.spring);
            }
            yield return(new WaitForSeconds(0.5f));

            MenuBtn.MoveTo(new Vector3(-150f, -150f, 0f) * GameManager.NGUI_SCALE, 0.5f, 0f, EaseType.spring);
            ShareBtn.MoveTo(new Vector3(0f, -200f, 0f) * GameManager.NGUI_SCALE, 0.5f, 0f, EaseType.spring);
            RestartBtn.MoveTo(new Vector3(150f, -150f, 0f) * GameManager.NGUI_SCALE, 0.5f, 0f, EaseType.spring);
            yield return(new WaitForSeconds(0.5f));
        }
Example #2
0
        private void Main_UserScoreInited(IScore score, LeaderboardCollection collection, LeaderboardTimeSpan interval)
        {
            int best = (int)score.value;

            switch (interval)
            {
            case LeaderboardTimeSpan.Daily:
                PlayGameServiceManager.GetUserScore(LeaderboardCollection.Public, LeaderboardTimeSpan.Weekly);
                GameData.DailyBest = best;
                GameData.DailyRank = score.rank;
                if (DailyScoreInited != null)
                {
                    DailyScoreInited(score);
                }
                break;

            case LeaderboardTimeSpan.Weekly:
                PlayGameServiceManager.GetUserScore(LeaderboardCollection.Public, LeaderboardTimeSpan.AllTime);
                GameData.WeeklyBest = best;
                GameData.WeeklyRank = score.rank;
                if (WeeklyScoreInited != null)
                {
                    WeeklyScoreInited(score);
                }
                break;

            case LeaderboardTimeSpan.AllTime:
                GameData.OverallBest = best;
                GameData.OverallRank = score.rank;
                if (OverallScoreInited != null)
                {
                    OverallScoreInited(score);
                }
                break;
            }
        }
Example #3
0
 public void OnLeaderboardPressed()
 {
     PlayGameServiceManager.ShowLeaderboard();
 }
Example #4
0
 private void Main_SignetIn()
 {
     PlayGameServiceManager.GetUserScore(LeaderboardCollection.Public, LeaderboardTimeSpan.Daily);
 }
Example #5
0
 private void Main_ScoreReported(bool obj)
 {
     PlayGameServiceManager.GetUserScore(LeaderboardCollection.Public, LeaderboardTimeSpan.Daily);
 }