示例#1
0
        public static IIgniteGUIGroup AddMonitoringLabel(this IIgniteGUIGroup group, Func <string> monitor)
        {
            var labelChangeEvent = new IgniteLabel.LabelChangeEvent();
            var label            = IgniteLabel.Create("");

            label.StartCoroutine(MonitoringCoroutine(() =>
            {
                if (label == null)
                {
                    return;
                }

                label.labelText.text = monitor();
            }));
            return(group.Add(label));
        }
示例#2
0
        public static IIgniteGUIGroup AddMonitoringHighligtedLabel(this IIgniteGUIGroup group, Func <string> monitor, Func <Color> colorMonitor)
        {
            var labelChangeEvent = new IgniteLabel.LabelChangeEvent();
            var label            = IgniteLabel.Create("");

            label.StartCoroutine(MonitoringCoroutine(() =>
            {
                if (label == null)
                {
                    return;
                }

                var color                      = colorMonitor();
                label.labelText.text           = monitor();
                label.labelText.color          = LuminanceUtility.ChooseFontColor(color);
                label.backgroundImage.color    = color;
                label.highlightBackgroundColor = color;
                label.defaultBackgroundColor   = color;
            }));
            return(group.Add(label));
        }
示例#3
0
 public static IIgniteGUIGroup AddLabel(this IIgniteGUIGroup group, string label, Color?fontColor = null, Color?defaultBackgroundColor = null, Color?highlightBackgroundColor = null)
 {
     return(group.Add(IgniteLabel.Create(label, fontColor, defaultBackgroundColor, highlightBackgroundColor)));
 }
示例#4
0
 public static IIgniteGUIGroup AddLabel(this IIgniteGUIGroup group, string label, UnityEvent <string> labelChangeEvent = null)
 {
     return(group.Add(IgniteLabel.Create(label, labelChangeEvent)));
 }