public static void SetButtonUnderlineColor(this Button parent, Color color) { HMUI.ImageView img = parent.GetComponentsInChildren <HMUI.ImageView>().FirstOrDefault(x => x.name == "Underline"); if (img != null) { img.color = color; } }
public static void SetButtonBackgroundActive(this Button parent, bool active) { HMUI.ImageView img = parent.GetComponentsInChildren <HMUI.ImageView>().Last(x => x.name == "BG"); if (img != null) { img.gameObject.SetActive(active); } }
public static void SetButtonBorder(this Button button, Color color) { HMUI.ImageView img = button.GetComponentsInChildren <HMUI.ImageView>().FirstOrDefault(x => x.name == "Border"); if (img != null) { img.color0 = color; img.color1 = color; img.color = color; img.fillMethod = Image.FillMethod.Horizontal; img.SetAllDirty(); } }