예제 #1
0
 private void OnDisable()
 {
     if (MinigameManager.GetActive() != null)
     {
         MinigameManager.GetActive().StopSFX(mg_jr_Sound.ROBOT_HELI_LOOP.ClipName());
     }
 }
 public void CompleteRound()
 {
     if (m_isPlaying)
     {
         StopTimer();
         m_pufflesCaught  = GetComponent <mg_pr_GameLogic>().caught;
         m_pufflesEscaped = GetComponent <mg_pr_GameLogic>().escaped;
         if (m_pufflesCaught > 0)
         {
             m_bonusTime = m_gameTime / 2f;
             UpdateScore();
             m_complete  = true;
             m_isPlaying = false;
             MinigameManager.GetActive().CoinsEarned = (int)m_coinsTotal;
             UIManager.Instance.OpenScreen("mg_pr_ResultScreen", toShowDarkMask: false, null, null);
         }
         else
         {
             m_bonusTime = 0f;
             UpdateScore();
             m_failed    = true;
             m_isPlaying = false;
             UIManager.Instance.OpenScreen("mg_pr_ResultScreen", toShowDarkMask: false, null, null);
         }
     }
 }
 public void OnGameOver(bool _didWin)
 {
     if (_didWin)
     {
         MinigameManager.GetActive <mg_BeanCounter>().CoinsEarned += GetVictoryBonus();
     }
 }
예제 #4
0
        private void Awake()
        {
            mg_JetpackReboot active    = MinigameManager.GetActive <mg_JetpackReboot>();
            mg_jr_Resources  resources = active.Resources;
            Vector3          position  = new Vector3(-16f, active.VisibleWorldBounds.max.y, 0f);

            base.transform.position = position;
            m_highestLinePosition   = active.VisibleWorldBounds.max.y;
            m_lowestLinePosition    = active.VisibleWorldBounds.min.y;
            float num = m_highestLinePosition - m_lowestLinePosition;

            m_lineSpacing = num / (float)(m_maxLineFX - 2);
            for (int i = 0; i < m_maxLineFX; i++)
            {
                GameObject pooledResource = resources.GetPooledResource(mg_jr_ResourceList.GAME_PREFAB_EFFECT_SPEEDLINE);
                Animator   component      = pooledResource.GetComponent <Animator>();
                Assert.NotNull(component, "SpeedLine needs an animator");
                pooledResource.transform.position = new Vector3(base.transform.position.x, m_highestLinePosition - (float)i * m_lineSpacing, 0f);
                pooledResource.transform.parent   = base.transform;
                SpriteRenderer component2 = pooledResource.GetComponent <SpriteRenderer>();
                component2.sortingOrder = mg_jr_SpriteDrawingLayers.Instance.SpriteOrder(mg_jr_SpriteDrawingLayers.DrawingLayers.FX_OVERLAY_0);
                m_speedLines.Add(component);
            }
            m_speedLines = m_speedLines.OrderBy((Animator item) => Random.Range(0, m_speedLines.Count)).ToList();
        }
예제 #5
0
        protected void Update()
        {
            bool flag = m_logic.GameState == mg_ss_EGameState.COUNTDOWN;

            m_image.enabled = flag;
            if (flag)
            {
                int   num  = 0;
                float num2 = m_logic.CountdownTotalTime / 3f;
                if (m_logic.CountdownTimer < num2)
                {
                    num = 3;
                }
                else if (m_logic.CountdownTimer < num2 * 2f)
                {
                    num = 2;
                }
                else if (m_logic.CountdownTimer < num2 * 3f)
                {
                    num = 1;
                }
                m_animator.SetInteger(ANIM_PARAM_COUNTDOWN, num);
                UpdateAlpha(m_logic.CountdownTimer % num2, num2);
                if (num != m_numberDisplayed)
                {
                    m_numberDisplayed = num;
                    MinigameManager.GetActive().PlaySFX("mg_ss_sfx_countdown_timer");
                }
            }
        }
예제 #6
0
    private void UpdateResults()
    {
        mg_ss_Score scoring = MinigameManager.GetActive <mg_SmoothieSmash>().GameLogic.Scoring;

        Text[] componentsInChildren = GetComponentsInChildren <Text>();
        Text[] array = componentsInChildren;
        foreach (Text text in array)
        {
            switch (text.gameObject.name)
            {
            case "custom":
                text.text = scoring.CustomText;
                break;

            case "custom_value":
                text.text = scoring.CustomValue.ToString();
                break;

            case "score_value":
                text.text = scoring.Score.ToString();
                break;

            case "coins_value":
                text.text = scoring.Coins.ToString();
                break;
            }
        }
    }
 private void OnPlayClicked()
 {
     MinigameManager.GetActive().PlaySFX("mg_bc_sfx_UISelect");
     UIManager.Instance.PopScreen();
     UIManager.Instance.PopScreen();
     MinigameManager.GetActive <mg_BeanCounter>().LaunchGame();
 }
예제 #8
0
 private void Start()
 {
     m_resources.LoadResources();
     SetMainCamera("mg_pr_MainCamera");
     MinigameManager.GetActive().PlaySFX("mg_pr_sfx_main");
     UIManager.Instance.OpenScreen("mg_pr_TitleScreen", toShowDarkMask: false, null, null);
 }
예제 #9
0
 private void Start()
 {
     m_renderers = GetComponentsInChildren <SpriteRenderer>();
     m_miniGame  = MinigameManager.GetActive <mg_JetpackReboot>();
     m_resources = m_miniGame.Resources;
     Assert.IsTrue(m_renderers.Length > 0, "This component requires at least one sprite renderer");
 }
예제 #10
0
        private void Start()
        {
            mg_JetpackReboot active = MinigameManager.GetActive <mg_JetpackReboot>();

            m_scrollingData = active.GameLogic.ScrollingSpeed;
            ScrollingLayer  = mg_jr_SpriteDrawingLayers.DrawingLayers.OBSTACLE_0;
        }
 private void Start()
 {
     m_renderer  = GetComponentInChildren <SpriteRenderer>();
     m_miniGame  = MinigameManager.GetActive <mg_JetpackReboot>();
     m_resources = m_miniGame.Resources;
     Assert.NotNull(m_renderer, "This component requires a sprite renderer");
 }
예제 #12
0
        public override void OnCollection()
        {
            mg_JetpackReboot active = MinigameManager.GetActive <mg_JetpackReboot>();

            active.Resources.ReturnPooledResource(base.gameObject);
            active.PlaySFX(mg_jr_Sound.PICKUP_JETPACK.ClipName());
        }
예제 #13
0
        private void Update()
        {
            if (MinigameManager.IsPaused)
            {
                return;
            }
            switch (m_tuboCollectionState)
            {
            case TurboState.INACTIVE:
                break;

            case TurboState.FILLING:
                AdjustTurboPoints(Time.deltaTime * m_turboData.TurboPointGainRate);
                if (m_currentTurboPoints >= m_turboData.TurboPointsMax)
                {
                    MinigameManager.GetActive().PlaySFX(mg_jr_Sound.UI_JETPACK_FULL.ClipName());
                    m_currentTurboPoints = m_turboData.TurboPointsMax;
                    ChangeState(TurboState.FULL);
                }
                break;

            case TurboState.FULL:
                break;

            case TurboState.ENGAGED:
                AdjustTurboPoints(Time.deltaTime * m_turboDrainRate);
                break;

            default:
                Assert.IsTrue(condition: false, "Unhandled m_tuboCollectionState");
                break;
            }
        }
예제 #14
0
        public void Initialize()
        {
            mg_BeanCounter active = MinigameManager.GetActive <mg_BeanCounter>();

            if (!active.Resources.HasLoadedGameSounds)
            {
                active.Resources.LoadGameSounds();
            }
            m_background = active.Resources.GetInstancedResource(mg_bc_EResourceList.GAME_ASSET_BACKGROUND);
            MinigameSpriteHelper.SetSpriteLayer(m_background, -100);
            Vector3 localScale = m_background.transform.localScale;

            MinigameSpriteHelper.FitSpriteToScreen(active.MainCamera, m_background, _preserveAspect: false);
            MinigameSpriteHelper.AssignParent(m_background, base.gameObject);
            base.gameObject.transform.localScale = m_background.transform.localScale;
            m_background.transform.localScale    = localScale;
            GameObject gameObject = base.gameObject.transform.Find("mg_bc_penguin").gameObject;

            Penguin           = gameObject.GetComponent <mg_bc_Penguin>();
            Penguin.GameLogic = this;
            GameObject gameObject2 = base.gameObject.transform.Find("mg_bc_dropzone").gameObject;

            DropZone = gameObject2.GetComponent <mg_bc_DropZone>();
            GameObject gameObject3 = base.gameObject.transform.Find("mg_bc_truck").gameObject;

            Truck = gameObject3.GetComponent <mg_bc_Truck>();
            Truck.CanSpawnLives = Penguin.Lives.Value < 4;
            GameObject gameObject4 = base.gameObject.transform.Find("mg_bc_left_edge").gameObject;
            GameObject gameObject5 = base.gameObject.transform.Find("mg_bc_right_edge").gameObject;

            Penguin.SetMovementLimits(gameObject4.transform.localPosition.x, gameObject5.transform.localPosition.x);
            ScoreController.Initialize(Truck);
        }
예제 #15
0
    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;
        }
    }
예제 #16
0
 internal void PenguinUpdate(float _deltaTime)
 {
     if (IsDead)
     {
         float deadCooldown = m_deadCooldown;
         m_deadCooldown += _deltaTime;
         int num  = (int)(3f - deadCooldown + 1f);
         int num2 = (int)(3f - m_deadCooldown + 1f);
         if (num != num2 && num2 > 0)
         {
             MinigameManager.GetActive().PlaySFX("mg_bc_sfx_UICountdown321");
             GameLogic.NoticeDisplayer.ShowMessage(num2 + "\nTry Again...", 1f);
         }
         if (m_deadCooldown >= 3f)
         {
             Revive();
         }
     }
     else if (m_isShielded)
     {
         m_shieldTimer -= _deltaTime;
         if (m_shieldTimer <= 0f)
         {
             RemoveShield();
         }
         else if (m_shieldTimer < 3f)
         {
             SpriteRenderer component = m_shield.GetComponent <SpriteRenderer>();
             Color          color     = component.color;
             color.a         = 0.5f * (Mathf.Sin(5.23f * m_shieldTimer - (float)Math.PI / 2f) + 1f);
             component.color = color;
         }
     }
 }
예제 #17
0
        public override void OnCollection()
        {
            mg_JetpackReboot active = MinigameManager.GetActive <mg_JetpackReboot>();

            active.Resources.ReturnPooledResource(base.gameObject);
            GameObject     instancedResource = active.Resources.GetInstancedResource(mg_jr_ResourceList.GAME_PREFAB_EFFECT_COIN_PICKUP);
            SpriteRenderer component         = GetComponent <SpriteRenderer>();
            SpriteRenderer component2        = instancedResource.GetComponent <SpriteRenderer>();

            Assert.NotNull(component2, "Effect must have a spriterenderer");
            component2.sortingOrder = mg_jr_SpriteDrawingLayers.Instance.SpriteOrder(mg_jr_SpriteDrawingLayers.DrawingLayers.OBSTACLE_0);
            Vector3 center = component2.bounds.center;
            Vector3 vector = instancedResource.transform.position - center;

            if (component != null)
            {
                instancedResource.transform.position = component.bounds.center + vector;
            }
            else
            {
                DisneyMobile.CoreUnitySystems.Logger.LogWarning(base.gameObject, "Gameobject" + base.gameObject.name + "spawning coin pickup effect has no spriterenderer.");
                instancedResource.transform.position = base.transform.position + vector;
            }
            if (base.Quantity == 10)
            {
                active.PlaySFX(mg_jr_Sound.PICKUP_COIN_10.ClipName());
            }
            else
            {
                active.PlaySFX(mg_jr_Sound.PICKUP_COIN.ClipName());
            }
        }
예제 #18
0
        private void UpdateBagCount()
        {
            int count = m_heldBagsStack.Count;

            m_warning.SetActive(count == 5);
            m_sweat.SetActive(count == 5);
            if (count == 5)
            {
                MinigameManager.GetActive().PlaySFX("mg_bc_sfx_PlayerOverloadBagsStart");
                MinigameManager.GetActive().PlaySFX("mg_bc_sfx_PlayerOverloadBagsLoop");
            }
            else
            {
                MinigameManager.GetActive().StopSFX("mg_bc_sfx_PlayerOverloadBagsLoop");
            }
            if (count > 5)
            {
                MinigameManager.GetActive().PlaySFX("mg_bc_sfx_BagOverloadPlayer");
                Die(mg_bc_EPenguinDeaths.DEATH_TOO_MANY_BAGS);
            }
            else
            {
                m_animator.SetInteger("held_bags", count);
            }
        }
    private void Start()
    {
        Button[] componentsInChildren = base.gameObject.GetComponentsInChildren <Button>();
        Button[] array = componentsInChildren;
        foreach (Button button in array)
        {
            if (button.gameObject.name == "mg_bc_play_button")
            {
                m_playButton = button;
            }
            else if (button.gameObject.name == "mg_bc_back_button")
            {
                m_backButton = button;
            }
        }
        m_playButton.onClick.AddListener(OnPlayClicked);
        m_backButton.onClick.AddListener(OnBackClicked);
        Image[] componentsInChildren2 = base.gameObject.GetComponentsInChildren <Image>();
        Image[] array2 = componentsInChildren2;
        foreach (Image image in array2)
        {
            if (image.gameObject.name == "tint")
            {
                image.color = MinigameManager.Instance.GetPenguinColor();
            }
        }
        Transform child = base.gameObject.transform.GetChild(0);

        m_candyUI  = child.Find("mg_bc_jelly_instructions").gameObject;
        m_normalUI = child.Find("mg_bc_normal_instructions").gameObject;
        LoadGameMode(MinigameManager.GetActive <mg_BeanCounter>().GameMode);
    }
예제 #20
0
 private void OnDestroy()
 {
     if (m_sfxLoopName != null && MinigameManager.GetActive() != null)
     {
         MinigameManager.GetActive().StopSFX(SfxLoopName);
     }
 }
예제 #21
0
    protected override void Awake()
    {
        base.Awake();
        base.HasPauseButton      = false;
        base.ShouldShowPauseOver = false;
        mg_Pizzatron active          = MinigameManager.GetActive <mg_Pizzatron>();
        int          ordersCompleted = active.GameLogic.OrdersCompleted;
        Localizer    localizer       = null;

        if (Service.IsSet <Localizer>())
        {
            localizer = Service.Get <Localizer>();
        }
        mg_pt_EResourceList assetTag;

        if (ordersCompleted <= 5)
        {
            assetTag = mg_pt_EResourceList.RESULT_BG_01;
            m_text   = ((localizer == null) ? "Kitchen Chaos!" : localizer.GetTokenTranslation("Activity.MiniGames.KitchenChaos"));
        }
        else if (ordersCompleted <= 30)
        {
            assetTag = mg_pt_EResourceList.RESULT_BG_02;
            m_text   = ((localizer == null) ? "On Special!" : localizer.GetTokenTranslation("Activity.MiniGames.OnSpecial"));
        }
        else
        {
            assetTag = mg_pt_EResourceList.RESULT_BG_03;
            m_text   = ((localizer == null) ? "Dish of the Day!" : localizer.GetTokenTranslation("Activity.MiniGames.DishoftheDay"));
        }
        m_canContinue = ordersCompleted >= 40 && active.GameLogic.Lives > 0;
        m_background  = active.Resources.GetInstancedResource(assetTag);
        MinigameSpriteHelper.AssignParentTransform(m_background, active.transform);
    }
예제 #22
0
    protected override void Awake()
    {
        mg_BeanCounter active = MinigameManager.GetActive <mg_BeanCounter>();

        active.StartGame();
        base.Awake();
    }
 public override void OnCollided(mg_ss_EPlayerAction p_playerAction)
 {
     m_logic.ComboReset();
     base.OnCollided(p_playerAction);
     m_logic.OnAnvilCollision(this);
     MinigameManager.GetActive().PlaySFX("mg_ss_sfx_anvil_impact");
 }
예제 #24
0
 protected virtual void Awake()
 {
     m_miniGame = MinigameManager.GetActive <mg_JetpackReboot>();
     Assert.NotNull(m_miniGame, "mini game not found");
     m_renderer = GetComponentsInChildren <SpriteRenderer>(includeInactive: true)[0];
     Assert.NotNull(m_renderer, "Renderer not found");
 }
예제 #25
0
 public override void OnCaught()
 {
     base.OnCaught();
     MinigameManager.GetActive().PlaySFX("mg_bc_sfx_BagCatch");
     base.gameObject.SetActive(value: false);
     m_state = mg_bc_EObjectState.STATE_HELD;
 }
예제 #26
0
 private void OnDisable()
 {
     if (MinigameManager.GetActive() != null)
     {
         MinigameManager.GetActive().StopSFX(mg_jr_Sound.UI_GARYTALK_LOOP.ClipName());
     }
 }
예제 #27
0
    private void OnCoinCountCompleted()
    {
        m_coinTransfer.SetBool("Transfer", value: false);
        m_coinTransfer.gameObject.SetActive(value: false);
        int coinsCollected = m_gameLogic.Player.CoinsCollected;

        if (coinsCollected > 0)
        {
            MinigameManager.GetActive().PlaySFX(mg_jr_Sound.PICKUP_COIN_10.ClipName());
        }
        if ((float)coinsCollected >= m_gameLogic.GameBalance.CoinsForBonusRobot)
        {
            m_bonusRobotBig.SetActive(value: true);
            string text = "";
            if (localizer != null)
            {
                m_runCoinbarLabel.text = localizer.GetTokenTranslation("Activity.MiniGames.Robot");
                text = localizer.GetTokenTranslation("Activity.MiniGames.GarysBonusAward");
            }
            else
            {
                m_runCoinbarLabel.text = "Congratulations! You earned a bonus Robot Penguin! Restart now to use it!";
                text = "These little guys can take a hit for you!";
            }
            m_runCoinbarLabel.fontSize = 16;
            m_gary.PerformSpeech(text, OnGarysBonusSpeechCompleted);
        }
        else
        {
            m_currentState = ResultScreenState.WAITING_TO_CLOSE;
        }
    }
예제 #28
0
    private IEnumerator Start()
    {
        mg_JetpackReboot minigame = MinigameManager.GetActive <mg_JetpackReboot>();

        m_goalManager = minigame.GoalManager;
        m_goalBars.AddRange(from x in GetComponentsInChildren <mg_jr_UIGoalBar>()
                            orderby x.transform.position.y
                            select x);
        IList <mg_jr_Goal> goals = m_goalManager.ActiveGoals;

        Assert.AreEqual(m_goalBars.Count, goals.Count, "Active goal count does not equal available goal bars");
        m_flyByPenguins.AddRange(from x in GetComponentsInChildren <mg_jr_FlyByPenguin>(includeInactive: true)
                                 orderby x.transform.position.y
                                 select x);
        Assert.AreEqual(m_flyByPenguins.Count, m_goalBars.Count, "Active flyby penguin count does not equal available goal bars");
        foreach (mg_jr_FlyByPenguin flyByPenguin in m_flyByPenguins)
        {
            flyByPenguin.FlyByCompleted += ReplaceCompletedGoal;
        }
        for (int i = 0; i < goals.Count; i++)
        {
            Assert.NotNull(goals[i], "Null goal in goal list");
            m_goalBars[i].GoalToDisplay = goals[i];
            if (goals[i].IsCurrentLevelComplete)
            {
                minigame.GameLogic.Player.AwardBonusCoins(goals[i].RewardForCurrentLevel);
                m_completedGoalIndexes.AddLast(i);
            }
        }
        minigame.MusicManager.SelectTrack(mg_jr_Sound.MENU_MUSIC_AMBIENT.ClipName());
        m_goalManager.ReplaceCompletedGoals();
        yield return(new WaitForSeconds(1f));

        ReplaceCompletedGoal();
    }
예제 #29
0
 protected override void Awake()
 {
     base.Awake();
     base.HasPauseButton      = false;
     base.ShouldShowPauseOver = false;
     Minigame = MinigameManager.GetActive <mg_PuffleRoundup>();
 }
예제 #30
0
 public void Start()
 {
     m_logic  = MinigameManager.GetActive <mg_IceFishing>().Logic;
     m_label  = GetComponentInChildren <Text>();
     m_sprite = GetComponentInChildren <Image>();
     SetActive(p_active: false);
 }