public void SetColor(mg_bc_EJellyColors _color) { Color = _color; if (m_tint != null) { m_tint.color = mg_bc_Constants.GetColorForJelly(Color); } }
public static Color GetColorForJelly(mg_bc_EJellyColors _jelly) { Color result = new Color(0f, 0f, 0f); switch (_jelly) { case mg_bc_EJellyColors.BLUE: result = new Color(0f, 0f, 1f); break; case mg_bc_EJellyColors.BLUE_GREEN: result = new Color(0f, 0.686f, 0.686f); break; case mg_bc_EJellyColors.GREEN: result = new Color(0f, 0.475f, 0f); break; case mg_bc_EJellyColors.GREEN_YELLOW: result = new Color(0f, 1f, 0f); break; case mg_bc_EJellyColors.YELLOW: result = new Color(1f, 1f, 0f); break; case mg_bc_EJellyColors.YELLOW_ORANGE: result = new Color(1f, 0.702f, 0f); break; case mg_bc_EJellyColors.ORANGE: result = new Color(1f, 0.5f, 0f); break; case mg_bc_EJellyColors.ORANGE_RED: result = new Color(1f, 0.275f, 0f); break; case mg_bc_EJellyColors.RED: result = new Color(1f, 0f, 0f); break; case mg_bc_EJellyColors.RED_VIOLET: result = new Color(0.8f, 0f, 0.686f); break; case mg_bc_EJellyColors.VIOLET: result = new Color(0.729f, 0f, 1f); break; case mg_bc_EJellyColors.VIOLET_BLUE: result = new Color(0.451f, 0.03f, 0.647f); break; } return(result); }
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); } } }
public static void Get90DegreeColors(mg_bc_EJellyColors _in, out mg_bc_EJellyColors _one, out mg_bc_EJellyColors _two) { int num = (int)(_in + 3); if (num >= 12) { num -= 12; } _one = (mg_bc_EJellyColors)num; int num2 = (int)(_in - 3); if (num2 < 0) { num2 += 12; } _two = (mg_bc_EJellyColors)num2; }
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); } }
internal bool IsTargetColor(mg_bc_EJellyColors _color) { return(m_targetColors.Contains(_color)); }