Skip to content

Commit 6766f16

Browse files
Add UxmlElement attribute support for Unity v6.0+ (#138)
1 parent 672bc73 commit 6766f16

File tree

2 files changed

+16
-6
lines changed

2 files changed

+16
-6
lines changed

Editor/DependencyManager/UIElements/Widgets/Sdk/Cards/Shell/SdkCardShell.cs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,18 @@
33

44
namespace AppodealInc.Mediation.DependencyManager.Editor
55
{
6-
internal class SdkCardShell : VisualElement
6+
#if UNITY_6000_0_OR_NEWER
7+
[UxmlElement]
8+
#else
9+
// ReSharper disable once PartialTypeWithSinglePart
10+
#endif
11+
internal partial class SdkCardShell : VisualElement
712
{
813
private const string CommonStyleSheetPath = "Appodeal/DependencyManager/SdkCards/SdkCardsCommon";
914

10-
#pragma warning disable CS0618 // Type or member is obsolete
15+
#if !UNITY_6000_0_OR_NEWER
1116
public new class UxmlFactory : UxmlFactory<SdkCardShell> { }
12-
#pragma warning restore CS0618 // Type or member is obsolete
17+
#endif
1318

1419
public SdkCardShellView View { get; }
1520

Editor/DependencyManager/UIElements/Widgets/Sdk/VersionDropdown/SdkVersionDropdown.cs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,16 @@
55

66
namespace AppodealInc.Mediation.DependencyManager.Editor
77
{
8-
internal class SdkVersionDropdown : VisualElement, IDisposable
8+
#if UNITY_6000_0_OR_NEWER
9+
[UxmlElement]
10+
#else
11+
// ReSharper disable once PartialTypeWithSinglePart
12+
#endif
13+
internal partial class SdkVersionDropdown : VisualElement, IDisposable
914
{
10-
#pragma warning disable CS0618 // Type or member is obsolete
15+
#if !UNITY_6000_0_OR_NEWER
1116
public new class UxmlFactory : UxmlFactory<SdkVersionDropdown> { }
12-
#pragma warning restore CS0618 // Type or member is obsolete
17+
#endif
1318

1419
private readonly DropdownButtonController _buttonController;
1520
private readonly DropdownPopupController _popupController;

0 commit comments

Comments
 (0)