Skip to content

Commit

Permalink
feat(UIComponent): remove warning messages from when no layout or sty…
Browse files Browse the repository at this point in the history
…lesheet files exist
  • Loading branch information
jonisavo committed May 1, 2022
1 parent 8ebfa4e commit cf72d2d
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions Assets/UIComponents/Core/UIComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ protected virtual StyleSheet[] GetStyleSheets()

if (styleSheet == null)
{
Debug.LogError($"Could not find stylesheet {assetPath} for {GetType().Name}");
Debug.LogError($"Could not find stylesheet {assetPath} for {_componentType.Name}");
continue;
}

Expand Down Expand Up @@ -146,22 +146,18 @@ protected virtual StyleSheet[] GetStyleSheets()
private void LoadLayout()
{
var layoutAsset = GetLayout();

if (layoutAsset)
layoutAsset.CloneTree(this);
else
Debug.LogWarningFormat("Could not find layout for {0}", _componentType.Name);
}

private void LoadStyles()
{
var loadedStyleSheets = GetStyleSheets();

if (loadedStyleSheets.Length == 0)
{
Debug.LogWarningFormat("Could not find styles for {0}", _componentType.Name);
return;
}


foreach (var sheet in loadedStyleSheets)
if (sheet != null)
styleSheets.Add(sheet);
Expand Down

0 comments on commit cf72d2d

Please sign in to comment.