コード例 #1
0
        protected override void OnCaughtBag(mg_bc_Bag _bag)
        {
            mg_bc_JellyBag component = _bag.GetComponent <mg_bc_JellyBag>();

            if (m_heldBagsStack.Count < 5)
            {
                m_tintSprites[m_heldBagsStack.Count].color = mg_bc_Constants.GetColorForJelly(component.Color);
            }
            base.OnCaughtBag(_bag);
        }
コード例 #2
0
 internal override void TakeBag()
 {
     if (m_penguin != null)
     {
         mg_bc_Bag mg_bc_Bag2 = m_penguin.RemoveBag();
         if (mg_bc_Bag2 != null)
         {
             mg_bc_JellyBag     component = mg_bc_Bag2.GetComponent <mg_bc_JellyBag>();
             mg_bc_EJellyColors color     = component.Color;
             mg_bc_ScoreController.Instance.OnBagThrownBack(IsTargetColor(color));
             MinigameManager.GetActive().PlaySFX("mg_bc_sfx_BagTossTruck");
             ThrowBack(mg_bc_Bag2);
         }
     }
 }
コード例 #3
0
        private void ThrowBack(mg_bc_Bag _bag)
        {
            Rigidbody2D component  = _bag.GetComponent <Rigidbody2D>();
            Rigidbody2D component2 = m_penguin.GetComponent <Rigidbody2D>();

            _bag.gameObject.SetActive(value: true);
            component.velocity = Vector2.zero;
            component.position = new Vector2(component2.position.x, component2.position.y + 3f);
            component.AddForce(new Vector2(200f, 600f));
            SpriteRenderer[] componentsInChildren = _bag.GetComponentsInChildren <SpriteRenderer>();
            SpriteRenderer[] array = componentsInChildren;
            foreach (SpriteRenderer spriteRenderer in array)
            {
                spriteRenderer.enabled = false;
            }
            m_lastBagThrownBack = Time.time;
            m_bagsToThrowBack.Add(_bag);
        }
コード例 #4
0
        protected override void AddBag(mg_bc_Bag _bag)
        {
            mg_bc_JellyBag     component = _bag.GetComponent <mg_bc_JellyBag>();
            mg_bc_EJellyColors color     = component.Color;

            if (Truck.IsTargetColor(color))
            {
                base.AddBag(_bag);
                GameObject gameObject = m_bags[m_storedBags - 1].transform.GetChild(0).gameObject;
                gameObject.GetComponent <SpriteRenderer>().color = mg_bc_Constants.GetColorForJelly(color);
                if (m_wrongBag != null && m_wrongBagLines != null)
                {
                    Color color2 = m_wrongBagLines.color;
                    color2.a = 1f;
                    m_wrongBagLines.color = color2;
                }
                m_wrongBag      = null;
                m_wrongBagTint  = null;
                m_wrongBagLines = null;
            }
            else
            {
                mg_bc_ScoreController.Instance.OnBagUnloaded(_isCorrect: false);
                MinigameManager.GetActive().PlaySFX("mg_bc_sfx_BagUnloadError");
                if (m_wrongBagsUnloaded % 3 == 0)
                {
                    MinigameManager.GetActive <mg_BeanCounter>().GameLogic.ShowHint("Throw back\nwrong bags!", 2f);
                }
                m_wrongBagsUnloaded++;
                m_wrongBag           = m_bags[m_storedBags];
                m_wrongBagTint       = m_wrongBag.transform.GetChild(0).gameObject.GetComponent <SpriteRenderer>();
                m_wrongBagLines      = m_wrongBag.transform.GetChild(1).gameObject.GetComponent <SpriteRenderer>();
                m_wrongBagTint.color = mg_bc_Constants.GetColorForJelly(color);
                m_wrongBag.SetActive(value: true);
            }
        }