public override void LoadUI(Dictionary <string, string> propertyList = null) { base.LoadUI(propertyList); 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_TapToPlayArea") { m_tapToPlayButton = button; } else if (button.gameObject.name == "mg_jr_GoalsButton") { m_goalButton = button; } } m_SpeechContainer = base.transform.Find("mg_jr_pf_StartScreen/mg_jr_SpeechBubble").gameObject; Assert.NotNull(m_SpeechContainer, "speech container not found"); m_garySpeechText = m_SpeechContainer.GetComponentsInChildren <Text>(includeInactive: true)[0]; Assert.NotNull(m_garySpeechText, "Speech label not found"); m_gary = m_gameLogic.IntroGary; m_tapToPlayButton.onClick.AddListener(OnTapToPlayClicked); m_goalButton.onClick.AddListener(OnGoalClicked); if (m_gary != null) { m_gary.OnDialogChanged += OnGaryDialogChange; } }
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; } else if (button.gameObject.name == "mg_jr_ResumeButton") { m_resumeButton = button; } } Toggle[] componentsInChildren2 = base.gameObject.GetComponentsInChildren <Toggle>(); Toggle[] array2 = componentsInChildren2; foreach (Toggle toggle in array2) { if (toggle.gameObject.name == "mg_jr_SfxButton") { m_sfxButton = toggle; m_sfxButton.isOn = m_gameLogic.MiniGame.AreSFXEnabled; } else if (toggle.gameObject.name == "mg_jr_MusicButton") { m_musicButton = toggle; m_musicButton.isOn = m_gameLogic.MiniGame.MusicManager.IsMusicEnabled; } } m_goalBars.AddRange(from x in base.gameObject.GetComponentsInChildren <mg_jr_UIGoalBar>() orderby x.transform.position.y select x); IList <mg_jr_Goal> activeGoals = active.GoalManager.ActiveGoals; Assert.AreEqual(m_goalBars.Count, activeGoals.Count, "Active goal count does not equal available goal bars"); for (int j = 0; j < activeGoals.Count; j++) { Assert.NotNull(activeGoals[j], "Null goal in goal list"); m_goalBars[j].GoalToDisplay = activeGoals[j]; } m_retryButton.onClick.AddListener(OnRetryClicked); m_quitButton.onClick.AddListener(OnQuitClicked); m_resumeButton.onClick.AddListener(OnResumeClicked); m_musicButton.onValueChanged.AddListener(OnMusicClicked); m_sfxButton.onValueChanged.AddListener(OnSfxClicked); active.MusicManager.IsPaused = true; }
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; }