Skip to content

Commit

Permalink
feat: remove Unity 2019 support
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Unity 2019 support has been removed.
  • Loading branch information
jonisavo committed Oct 15, 2022
1 parent 905a339 commit 2456730
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 90 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ jobs:
fail-fast: false
matrix:
unityVersion:
- 2019.4.40f1
- 2020.3.40f1
- 2021.3.11f1
- 2022.1.18f1
Expand Down Expand Up @@ -97,7 +96,6 @@ jobs:
fail-fast: false
matrix:
unityVersion:
- 2019.4.40f1
- 2020.3.40f1
- 2021.3.11f1
- 2022.1.18f1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ public IEnumerator IOnMouseLeave_Registers_MouseLeaveEvent_Callback()
yield return Assert_Registers_Event_Callback<UIComponentWithOnMouseLeave, MouseLeaveEvent>();
}

#if UNITY_2020_3_OR_NEWER
private class UIComponentWithOnClick : BaseTestComponent, IOnClick
{
public void OnClick(ClickEvent evt) => Fired = true;
Expand All @@ -112,7 +111,7 @@ public IEnumerator IOnClick_Registers_ClickEvent_Callback()
{
yield return Assert_Registers_Event_Callback<UIComponentWithOnClick, ClickEvent>();
}
#endif
#if UNITY_2021_3_OR_NEWER
private class UIComponentWithOnNavigationMove : BaseTestComponent, IOnNavigationMove
{
Expand Down
4 changes: 1 addition & 3 deletions Assets/UIComponents/Core/EventInterfaces/IOnClick.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#if UNITY_2020_3_OR_NEWER
using UnityEngine.UIElements;
using UnityEngine.UIElements;

namespace UIComponents
{
Expand All @@ -13,4 +12,3 @@ public interface IOnClick
void OnClick(ClickEvent evt);
}
}
#endif
67 changes: 0 additions & 67 deletions Assets/UIComponents/Core/Internal/Unity2019CompatibilityUtils.cs

This file was deleted.

This file was deleted.

14 changes: 2 additions & 12 deletions Assets/UIComponents/Core/UIComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,10 @@ private void RegisterEventInterfaceCallbacks()

if (this is IOnMouseLeave onMouseLeave)
RegisterCallback<MouseLeaveEvent>(onMouseLeave.OnMouseLeave);

#if UNITY_2020_3_OR_NEWER

if (this is IOnClick onClick)
RegisterCallback<ClickEvent>(onClick.OnClick);
#endif
#if UNITY_2021_3_OR_NEWER
if (this is IOnNavigationMove onNavigationMove)
RegisterCallback<NavigationMoveEvent>(onNavigationMove.OnNavigationMove);
Expand Down Expand Up @@ -343,16 +342,7 @@ private void PopulateQueryFields()
var results = new List<VisualElement>();

for (var i = 0; i < queryAttributes.Length; i++)
{
#if !UNITY_2020_3_OR_NEWER
if (queryAttributes[i].Name == null && queryAttributes[i].Class == null)
{
Unity2019CompatibilityUtils.QueryByDesiredType(queryAttributes[i], this, concreteType, results);
continue;
}
#endif
queryAttributes[i].Query(this, results);
}

results.RemoveAll(result => !concreteType.IsInstanceOfType(result));

Expand Down
2 changes: 1 addition & 1 deletion Assets/UIComponents/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"displayName": "UIComponents",
"version": "0.26.0",
"description": "A small front-end framework for Unity's UIToolkit.",
"unity": "2019.3",
"unity": "2020.3",
"dependencies": {
"com.unity.roslyn": "0.2.2-preview"
},
Expand Down

0 comments on commit 2456730

Please sign in to comment.