protected override void MatchRect() { if (!((Object)RectMain == (Object)null) && !((Object)RectShadow == (Object)null)) { if ((Object)shadowText == (Object)null) { shadowText = RectShadow.GetComponent <Text>(); } if ((Object)mainText == (Object)null) { mainText = RectMain.GetComponent <Text>(); } if (!((Object)shadowText == (Object)null) && !((Object)mainText == (Object)null)) { if ((Object)shadowText.font != (Object)mainText.font) { shadowText.font = mainText.font; } if (shadowText.fontSize != mainText.fontSize) { shadowText.fontSize = mainText.fontSize; } if (shadowText.alignment != mainText.alignment) { shadowText.alignment = mainText.alignment; } if (shadowText.lineSpacing != mainText.lineSpacing) { shadowText.lineSpacing = mainText.lineSpacing; } string text = mainText.text; text = Regex.Replace(text, "\\</?color\\b.*?\\>", string.Empty); if (shadowText.text != text) { shadowText.text = text; } if (shadowText.color != shadowColor) { shadowText.color = shadowColor; } if (shadowText.horizontalOverflow != mainText.horizontalOverflow) { shadowText.horizontalOverflow = mainText.horizontalOverflow; } if (shadowText.verticalOverflow != mainText.verticalOverflow) { shadowText.verticalOverflow = mainText.verticalOverflow; } base.MatchRect(); } } }
protected override void MatchRect() { base.MatchRect(); if (!((Object)RectMain == (Object)null) && !((Object)RectShadow == (Object)null)) { if ((Object)shadowImage == (Object)null) { shadowImage = RectShadow.GetComponent <Image>(); } if ((Object)mainImage == (Object)null) { mainImage = RectMain.GetComponent <Image>(); } if ((Object)mainImage == (Object)null) { if ((Object)shadowImage != (Object)null) { shadowImage.color = Color.clear; } } else if (!((Object)shadowImage == (Object)null)) { if ((Object)shadowImage.sprite != (Object)mainImage.sprite) { shadowImage.sprite = mainImage.sprite; } if (shadowImage.color != shadowColor) { if ((Object)shadowImage.sprite != (Object)null) { shadowImage.color = shadowColor; } else { shadowImage.color = Color.clear; } } } } }