void Update() { dt = M.Clamp(dt + DT, 0, time); t = curve.Evaluate(dt / time); style.fontSize = fontSize; style.normal.textColor = Col.A(foregroundColor, foregroundColor.a * t); style.normal.background = FillTexture(1, 1, Col.A(backgroundColor, backgroundColor.a * t)); }
protected override void OnSkinUI() { base.OnSkinUI(); if (skinData.isUpdate) { Color color = skinData.colors[colorIdx >= skinData.colors.Count ? 0 : colorIdx]; Font font = skinData.fonts[fontIdx >= skinData.fonts.Count ? 0 : fontIdx]; Text text = null; switch (type) { case UIType.Text: text = go.Gc <Text> (); if (text) { text.color = Col.A(color, isAplha ? text.color.a : color.a); text.font = font; } break; case UIType.TextColor: text = go.Gc <Text> (); if (text) { text.color = Col.A(color, isAplha ? text.color.a : color.a); } break; case UIType.TextFont: text = go.Gc <Text> (); if (text) { text.font = font; } break; case UIType.Shadow: Shadow shadow = go.Gc <Shadow> (); if (shadow) { shadow.effectColor = color; } break; case UIType.Image: Image image = go.Gc <Image> (); if (image) { image.color = color; } break; } } }
private void Update() { alpha = M.Clamp01(alpha); for (int i = 0; i < tmpLis.Count; i++) { tmpLis[i].color = Col.A(tmpLis[i].color, tmpALis[i] * alpha); } for (int i = 0; i < tmLis.Count; i++) { tmLis[i].color = Col.A(tmLis[i].color, tmALis[i] * alpha); } for (int i = 0; i < txtLis.Count; i++) { txtLis[i].color = Col.A(txtLis[i].color, txtALis[i] * alpha); } for (int i = 0; i < imgLis.Count; i++) { imgLis[i].color = Col.A(imgLis[i].color, imgALis[i] * alpha); } }
void Update() { t += isAlphaDown ? -DT : DT; isAlphaDown = t <0 || t> duration ? !isAlphaDown : isAlphaDown; text.color = Col.A(text.color, t / duration); }