From dd24d69cf4ac8d2c500cd22b217d1028236d8a68 Mon Sep 17 00:00:00 2001 From: jellejurre Date: Tue, 14 May 2024 07:17:17 +0200 Subject: [PATCH] Add if define --- Editor/AV3Manager.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Editor/AV3Manager.cs b/Editor/AV3Manager.cs index 90cfbec..b192570 100644 --- a/Editor/AV3Manager.cs +++ b/Editor/AV3Manager.cs @@ -163,12 +163,14 @@ private void LoadTabs(VisualElement tabsArea) var iconElement = new VisualElement(); iconElement.style.backgroundImage = new StyleBackground(tab?.TabIcon); iconElement.style.flexGrow = 1; - + #if UNITY_2022_1_OR_NEWER iconElement.style.backgroundPositionX = new BackgroundPosition(BackgroundPositionKeyword.Center); iconElement.style.backgroundPositionY = new BackgroundPosition(BackgroundPositionKeyword.Center); iconElement.style.backgroundRepeat = new BackgroundRepeat(Repeat.NoRepeat, Repeat.NoRepeat); iconElement.style.backgroundSize = new BackgroundSize(BackgroundSizeType.Contain); - + #else + iconElement.style.unityBackgroundScaleMode = ScaleMode.ScaleToFit; + #endif tabButton.Add(iconElement); tabButton.AddToClassList("tab-button");