Skip to content

Commit

Permalink
feat(UIComponent)!: make GetLayout and GetStyleSheets private
Browse files Browse the repository at this point in the history
BREAKING CHANGE: UIComponent's GetLayout and GetStyleSheets functions are no longer protected and virtual. Since they are called in UIComponent's constructor, derived classes would not have been fully initialized when the overridden functions are called.
  • Loading branch information
jonisavo committed May 5, 2022
1 parent 8290195 commit 4251611
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions Assets/UIComponents/Core/UIComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,9 @@ protected bool TryProvide<T>(out T instance) where T : class
{
return _dependencyInjector.TryProvide(out instance);
}

/// <summary>
/// Returns the layout loaded in UIComponent's constructor.
/// </summary>
/// <returns>Component layout</returns>

[CanBeNull]
protected virtual VisualTreeAsset GetLayout()
private VisualTreeAsset GetLayout()
{
var layoutAttribute = LayoutAttributeDictionary[_componentType];

Expand All @@ -115,12 +111,8 @@ protected virtual VisualTreeAsset GetLayout()

return AssetResolver.LoadAsset<VisualTreeAsset>(assetPath);
}

/// <summary>
/// Returns the stylesheets loaded in UIComponent's constructor.
/// </summary>
/// <returns>Component stylesheets</returns>
protected virtual StyleSheet[] GetStyleSheets()

private StyleSheet[] GetStyleSheets()
{
var stylesheetAttributes = StylesheetAttributesDictionary[_componentType];

Expand Down

0 comments on commit 4251611

Please sign in to comment.