public void Refresh(bool invalidateCache) { if (string.IsNullOrEmpty(StyleKey)) { _activeStyle = null; return; } if (_cachedRoot == null || invalidateCache) { _cachedRoot = GetStyleRoot(); } if (_cachedRoot == null) { Debug.LogWarning("[StyleComponent] No active StyleRoot object found in parents.", this); _activeStyle = null; return; } var s = _cachedRoot.GetStyle(StyleKey); if (s == null) { Debug.LogWarning("[StyleComponent] Style not found ({0})".Fmt(StyleKey), this); _activeStyle = null; return; } _activeStyle = s; ApplyStyle(); }
public void CopyFrom(Style style) { Image = style.Image; NormalColor = style.NormalColor; HoverColor = style.HoverColor; ActiveColor = style.ActiveColor; DisabledColor = style.DisabledColor; }
public Style Copy() { var s = new Style(); s.CopyFrom(this); return s; }