コード例 #1
0
 public void ButtonReplayClick()
 {
     SaveGame.instance.deleteAll();
     SaveGame.instance.deleteList();
     UiManager.Instance.Popup.ButtonReplayClick();
     MyFirebase.LogButtonEvent(MyFirebase.EventButtonName.click_replay_pause);
 }
コード例 #2
0
 public void OnClick()
 {
     if (API.Instance.IsHasVideo())
     {
         API.Instance.ShowVideo(() =>
         {
             GameController.Instance.AddMoreRotate(3);
             NotifyController.Instance.ShowNotify("You got 3 rotate!");
             MyFirebase.LogButtonEvent(MyFirebase.EventButtonName.click_reward__get_rotate);
         });
     }
     else
     {
         // Notify
     }
 }
コード例 #3
0
ファイル: ButtonSound.cs プロジェクト: thaoabc/blockGame
    private void OnClick()
    {
        if (_isButtonSound)
        {
            SoundController.IsSoundOn = !SoundController.IsSoundOn;
            if (SoundController.IsSoundOn == false)
            {
                SoundController.Instance.StopAllSoundEffect();
            }

            if (SoundController.IsSoundOn)
            {
                MyFirebase.LogButtonEvent(MyFirebase.EventButtonName.click_on_sound);
            }
            else
            {
                MyFirebase.LogButtonEvent(MyFirebase.EventButtonName.click_off_sound);
            }
        }
        else
        {
            SoundController.IsMusicOn = !SoundController.IsMusicOn;
            if (SoundController.IsMusicOn == false)
            {
                SoundController.Instance.StopBackgroundMusic();
            }
            else
            {
                SoundController.Instance.PlayBackgroundMusic();
            }

            if (SoundController.IsMusicOn)
            {
                MyFirebase.LogButtonEvent(MyFirebase.EventButtonName.click_on_music);
            }
            else
            {
                MyFirebase.LogButtonEvent(MyFirebase.EventButtonName.click_off_music);
            }
        }
        UpdateState();
    }
コード例 #4
0
    public void CheckHighScoreWhenReplay()
    {
        if (GameController.Score > GameController.BestScore)
        {
            // store best score
            GameController.BestScore = GameController.Score;
            SaveGame.instance.saveBestScore(GameController.Score);
            MyFirebase.LogUserProfile(MyFirebase.UserProfile.get_new_highscore);

            if (Application.platform == RuntimePlatform.Android)
            {
                GooglePlayServicesScript.ReportScore(GPGSIds.leaderboard_top_best_score, GameController.BestScore);
            }
            else if (Application.platform == RuntimePlatform.IPhonePlayer)
            {
                GooglePlayServicesScript.ReportScore(GooglePlayServicesScript.TopHighScore, GameController.BestScore);
            }

            GameController.Instance.AddMoreRotate(2);
            NotifyController.Instance.ShowNotify(string.Format("You have bonus {0} rotate from high score!", 2));
        }

        SaveGame.instance.saveScore(0);
    }
コード例 #5
0
 public void ButtonPauseClick()
 {
     UiManager.Instance.Popup.ShowPausePopup();
     MyFirebase.LogButtonEvent(MyFirebase.EventButtonName.click_pause_button);
 }
コード例 #6
0
ファイル: HomePage.cs プロジェクト: thaoabc/blockGame
 public void ButtonRateClick()
 {
     API.Instance.RateApp();
     MyFirebase.LogButtonEvent(MyFirebase.EventButtonName.click_rate_home);
 }
コード例 #7
0
ファイル: HomePage.cs プロジェクト: thaoabc/blockGame
 public void ButtonMoregameClick()
 {
     API.Instance.GotoStore();
     MyFirebase.LogButtonEvent(MyFirebase.EventButtonName.click_moregame);
 }
コード例 #8
0
ファイル: HomePage.cs プロジェクト: thaoabc/blockGame
 public void PlayGame()
 {
     GameController.Instance.StartGame();
     SoundController.Instance.PlayBackgroundMusic(SoundController.Instance.InGameBackgroundSound);
     MyFirebase.LogButtonEvent(MyFirebase.EventButtonName.click_play_in_home);
 }
コード例 #9
0
 public void ButtonMenuClick()
 {
     SaveGame.instance.deleteAll();
     UiManager.Instance.Popup.ButtonMenuClick();
     MyFirebase.LogButtonEvent(MyFirebase.EventButtonName.click_menu_pause);
 }
コード例 #10
0
 public void ButtonContinueClick()
 {
     UiManager.Instance.Popup.ButtonContinueClick();
     MyFirebase.LogButtonEvent(MyFirebase.EventButtonName.click_continue_pause);
 }
コード例 #11
0
 public void ButtonReplayClick()
 {
     UiManager.Instance.Popup.ButtonReplayClick();
     MyFirebase.LogButtonEvent(MyFirebase.EventButtonName.click_replay_gameover);
 }
コード例 #12
0
 public void ButtonMenuClick()
 {
     UiManager.Instance.Popup.ButtonMenuClick();
     MyFirebase.LogButtonEvent(MyFirebase.EventButtonName.click_menu_gameover);
 }
コード例 #13
0
    public void ShowGameoverPopup()
    {
        // Check score to bonus
        if (GameController.Score >= 1000)
        {
            _countGameover++;
        }

        bool isBonusHighScore = true;

        if (_countGameover >= 10)
        {
            int bonus = Random.Range(3, 6);
            GameController.Instance.AddMoreRotate(bonus);
            NotifyController.Instance.ShowNotify(string.Format("You have bonus {0} rotate!", bonus));
            MyFirebase.LogUserProfile(MyFirebase.UserProfile.get_level_bonus);
            isBonusHighScore = false;
        }

        HideAll();
        // Check best score
        if (GameController.Score > GameController.BestScore)
        {
            // store best score
            GameController.BestScore = GameController.Score;

            SaveGame.instance.saveBestScore(GameController.Score);

            // Show effect best score
            _bestScoreEffect.gameObject.SetActive(true);
            _newRewordEffect.SetActive(true);

            SoundController.Instance.PlaySoundEffect(SoundController.Instance.Firework);
            SoundController.Instance.PlaySoundEffect(SoundController.Instance.NewHighScore);

            MyFirebase.LogUserProfile(MyFirebase.UserProfile.get_new_highscore);

            if (isBonusHighScore)
            {
                GameController.Instance.AddMoreRotate(3);
                NotifyController.Instance.ShowNotify(string.Format("You have bonus {0} rotate!", 3));
            }


            if (Application.platform == RuntimePlatform.Android)
            {
                GooglePlayServicesScript.ReportScore(GPGSIds.leaderboard_top_best_score, GameController.BestScore);
            }
            else if (Application.platform == RuntimePlatform.IPhonePlayer)
            {
                GooglePlayServicesScript.ReportScore(GooglePlayServicesScript.TopHighScore, GameController.BestScore);
            }
        }
        else
        {
            _bestScoreEffect.SetActive(false);
            _newRewordEffect.SetActive(false);
            //SoundController.Instance.PlaySoundEffect(SoundController.Instance.Gameover);
        }

        Show();
        _gameoverPopup.Show();
        SaveGame.instance.saveScore(0);
    }