Пример #1
0
 protected virtual void OnResume()
 {
     ResumeMusic();
     ResumeLoopingSFX();
     ClassicMiniGames.RemoveBackButtonHandler(PauseGame);
     ClassicMiniGames.PushBackButtonHandler(PauseGame);
 }
Пример #2
0
 private void AddEvents()
 {
     m_btnExit.onClick.AddListener(OnExitClicked);
     m_btnReplay.onClick.AddListener(OnReplayClicked);
     m_btnContinue.onClick.AddListener(OnContinueClicked);
     ClassicMiniGames.PushBackButtonHandler(OnExitClicked);
 }
Пример #3
0
 public override void LoadUI(Dictionary <string, string> propertyList = null)
 {
     Button[] componentsInChildren = base.gameObject.GetComponentsInChildren <Button>();
     Button[] array = componentsInChildren;
     foreach (Button button in array)
     {
         if (button.gameObject.name == "btn_exit")
         {
             m_ok = button;
         }
     }
     Text[] componentsInChildren2 = base.gameObject.GetComponentsInChildren <Text>();
     Text[] array2 = componentsInChildren2;
     foreach (Text text in array2)
     {
         if (text.gameObject.name == "txt_coins")
         {
             m_coinsEarnedLabel = text;
         }
         else if (text.gameObject.name == "txt_balance")
         {
             m_currentCoinsLabel = text;
         }
         else if (text.gameObject.name == "txt_name")
         {
             m_gameNameLabel = text;
         }
     }
     m_ok.onClick.AddListener(OnOKClicked);
     ClassicMiniGames.PushBackButtonHandler(OnOKClicked);
     UpdateLabels();
     base.LoadUI(propertyList);
 }
Пример #4
0
 private void Start()
 {
     Button[] componentsInChildren = base.gameObject.GetComponentsInChildren <Button>();
     Button[] array = componentsInChildren;
     foreach (Button button in array)
     {
         if (button.gameObject.name == "mg_bc_exit_button")
         {
             m_exitButton = button;
         }
         else if (button.gameObject.name == "mg_bc_replay_button")
         {
             m_replayButton = button;
         }
     }
     m_replayButton.onClick.AddListener(OnReplayClicked);
     m_exitButton.onClick.AddListener(OnExitClicked);
     ClassicMiniGames.PushBackButtonHandler(OnExitClicked);
     Text[] componentsInChildren2 = base.gameObject.GetComponentsInChildren <Text>();
     Text[] array2 = componentsInChildren2;
     foreach (Text text in array2)
     {
         if (text.gameObject.name == "mg_bc_result_title")
         {
             m_titleLabel = text;
         }
         else if (text.gameObject.name == "mg_bc_result_body")
         {
             m_bodyLabel = text;
         }
     }
     UpdateLabels();
 }
Пример #5
0
 public override void LoadUI(Dictionary <string, string> propertyList = null)
 {
     m_complete          = UIManager.Instance.ScreenRootObject.GetComponentInChildren <mg_pr_RoundController>().m_complete;
     m_failed            = UIManager.Instance.ScreenRootObject.GetComponentInChildren <mg_pr_RoundController>().m_failed;
     base.HasPauseButton = false;
     base.LoadUI(propertyList);
     Button[] componentsInChildren = base.gameObject.GetComponentsInChildren <Button>();
     Button[] array = componentsInChildren;
     foreach (Button button in array)
     {
         if (button.gameObject.name == "mg_pr_result_exit")
         {
             button.onClick.AddListener(OnBackClicked);
         }
         if (button.gameObject.name == "mg_pr_result_next")
         {
             button.onClick.AddListener(OnNextClicked);
             button.gameObject.SetActive(!m_failed);
         }
         if (button.gameObject.name == "mg_pr_result_replay")
         {
             button.onClick.AddListener(OnReplayClicked);
             button.gameObject.SetActive(!m_complete);
         }
     }
     ClassicMiniGames.PushBackButtonHandler(OnBackClicked);
     Text[] componentsInChildren2 = base.gameObject.GetComponentsInChildren <Text>();
     Text[] array2 = componentsInChildren2;
     foreach (Text text in array2)
     {
         if (text.gameObject.name == "mg_pr_time_remaining_count")
         {
             m_gameTime = UIManager.Instance.ScreenRootObject.GetComponentInChildren <mg_pr_UITimerCount>().m_timer;
             text.text  = m_gameTime.ToString("n0");
         }
         if (text.gameObject.name == "mg_pr_puffles_caught_count")
         {
             m_caught  = UIManager.Instance.ScreenRootObject.GetComponentInChildren <mg_pr_UICaughtCount>().m_caught;
             text.text = m_caught.ToString();
         }
         if (text.gameObject.name == "mg_pr_coins_round_count")
         {
             m_coinsRound = UIManager.Instance.ScreenRootObject.GetComponentInChildren <mg_pr_RoundController>().m_coinsRound;
             text.text    = m_coinsRound.ToString("n0");
         }
         if (text.gameObject.name == "mg_pr_total_coins_count")
         {
             m_coinsTotal = UIManager.Instance.ScreenRootObject.GetComponentInChildren <mg_pr_RoundController>().m_coinsTotal;
             text.text    = m_coinsTotal.ToString("n0");
         }
         if (text.gameObject.name == "mg_pr_bonus_time_count")
         {
             m_bonusTime = UIManager.Instance.ScreenRootObject.GetComponentInChildren <mg_pr_RoundController>().m_bonusTime;
             text.text   = m_bonusTime.ToString("n0");
         }
     }
 }
Пример #6
0
 public void Awake()
 {
     ClassicMiniGames.PushBackButtonHandler(OnExitPressed);
     AudioSource[] componentsInChildren = GetComponentsInChildren <AudioSource>();
     foreach (AudioSource audioSource in componentsInChildren)
     {
         audioSource.volume = ClassicMiniGames.MainGameSFXVolume;
     }
     CloseButtonAudioSource.volume = ClassicMiniGames.MainGameSFXVolume;
 }
Пример #7
0
 public virtual void Awake()
 {
     PasuseScreenName = "mg_PauseScreen";
     Time.timeScale   = 1f;
     if (MinigameManager.Instance == null)
     {
         DisneyMobile.CoreUnitySystems.Logger.LogFatal(this, "You can't run a minigame without a minigame manager! Don't run Minigame scenes directly!");
     }
     IsPaused             = false;
     CoinsEarned          = 0;
     AreSFXEnabled        = true;
     m_registeredMusic    = new List <AudioSource>();
     m_pausedMusic        = new List <AudioSource>();
     m_soundEffects       = new Dictionary <string, List <MinigameSFX> >();
     m_pausedSoundEffects = new List <MinigameSFX>();
     MinigameManager.Instance.OnMiniGameLoaded(this);
     UnityEngine.Random.InitState((int)DateTime.Now.Ticks);
     ClassicMiniGames.PushBackButtonHandler(PauseGame);
 }
Пример #8
0
    private void Start()
    {
        mg_JetpackReboot active = MinigameManager.GetActive <mg_JetpackReboot>();

        m_gameLogic = active.GameLogic;
        Button[] componentsInChildren = base.gameObject.GetComponentsInChildren <Button>();
        Button[] array = componentsInChildren;
        foreach (Button button in array)
        {
            if (button.gameObject.name == "mg_jr_RetryButton")
            {
                m_retryButton = button;
            }
            else if (button.gameObject.name == "mg_jr_QuitButton")
            {
                m_quitButton = button;
            }
        }
        m_retryButton.onClick.AddListener(OnRetryClicked);
        m_quitButton.onClick.AddListener(OnQuitClicked);
        ClassicMiniGames.PushBackButtonHandler(OnQuitClicked);
        Text[] componentsInChildren2 = base.gameObject.GetComponentsInChildren <Text>(includeInactive: true);
        Text[] array2 = componentsInChildren2;
        foreach (Text text in array2)
        {
            if (text.gameObject.name == "mg_jr_TotalCoinCount")
            {
                m_coinsCollectedSession      = text;
                m_coinsCollectedSession.text = string.Concat(m_gameLogic.Player.CoinsCollectedSession - m_gameLogic.Player.CoinsCollected);
            }
            else if (text.gameObject.name == "mg_jr_RunCoinCount")
            {
                text.text = string.Concat(m_gameLogic.Player.CoinsCollected);
            }
            else if (text.gameObject.name == "mg_jr_RunCoinsLabel")
            {
                m_runCoinbarLabel = text;
                if (localizer != null)
                {
                    m_runCoinbarLabel.text = localizer.GetTokenTranslation("Activity.MiniGames.CollectedCoins");
                }
                else
                {
                    m_runCoinbarLabel.text = "Collected Coins";
                }
            }
        }
        Transform[] componentsInChildren3 = base.gameObject.GetComponentsInChildren <Transform>(includeInactive: true);
        Transform[] array3 = componentsInChildren3;
        foreach (Transform transform in array3)
        {
            if (transform.gameObject.name == "mg_jr_ResultDistanceContainer")
            {
                m_resultdistanceContainer = transform.gameObject;
            }
            else if (transform.gameObject.name == "mg_jr_DistanceSparkle")
            {
                m_DistanceSparkleContainer = transform.gameObject;
            }
            else if (transform.gameObject.name == "mg_jr_RunCoinBar")
            {
                m_runCoinBar         = transform.gameObject;
                m_runCoinBarAnimator = m_runCoinBar.GetComponent <Animator>();
            }
            else if (transform.gameObject.name == "mg_jr_CoinTransfer")
            {
                m_coinTransfer = transform.GetComponent <Animator>();
            }
            else if (transform.gameObject.name == "mg_jr_BigBonusRobot")
            {
                m_bonusRobotBig = transform.gameObject;
            }
            else if (transform.gameObject.name == "mg_jr_LittleBonusRobot")
            {
                m_bonusRobotSmall = transform.gameObject;
            }
        }
        mg_jr_ResultCounter[] componentsInChildren4 = GetComponentsInChildren <mg_jr_ResultCounter>(includeInactive: true);
        mg_jr_ResultCounter[] array4 = componentsInChildren4;
        foreach (mg_jr_ResultCounter mg_jr_ResultCounter in array4)
        {
            if (mg_jr_ResultCounter.gameObject.name == "mg_jr_ResultDistance")
            {
                m_distanceCounter = mg_jr_ResultCounter;
                Assert.NotNull(m_distanceCounter, "distance conuter needed");
                m_distanceCounter.SfxLoopName = mg_jr_Sound.UI_POINTS_COUNTER_LOOP.ClipName();
                m_distanceCounter.PostFix     = "m";
            }
            else if (mg_jr_ResultCounter.gameObject.name == "mg_jr_TotalCoinCount")
            {
                m_coinCounter = mg_jr_ResultCounter;
                Assert.NotNull(m_coinCounter, "coin conuter needed");
                m_coinCounter.SfxLoopName = mg_jr_Sound.COIN_COLLECT_LOOP.ClipName();
            }
        }
        m_flybyPenguin = GetComponentsInChildren <mg_jr_FlyByPenguin>(includeInactive: true)[0];
        Assert.NotNull(m_flybyPenguin, "fly by penguin needed");
        m_flybyPenguin.PassingMiddleOfScreen += OnFlyByPenguinPassingMiddle;
        m_gary = GetComponentInChildren <mg_jr_ResultGary>();
        Assert.NotNull(m_gary, "Gary is needed");
        active.MusicManager.SelectTrack(mg_jr_Sound.MENU_MUSIC_AMBIENT.ClipName());
        m_currentState = ResultScreenState.PENGUIN_FLYBY_START;
    }