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); }
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); } } }
protected override GameObject GetBag() { GameObject bag = base.GetBag(); mg_bc_JellyBag component = bag.GetComponent <mg_bc_JellyBag>(); if (Random.value <= 0.3f) { int index = Random.Range(0, m_unwantedColors.Count); component.SetColor(m_unwantedColors[index]); } else { int index = Random.Range(0, m_targetColors.Count); component.SetColor(m_targetColors[index]); } return(bag); }
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); } }