diff --git a/Editor/AlicizaX.UI.Extension.Editor.asmdef b/Editor/AlicizaX.UI.Extension.Editor.asmdef index f98fc3a..fce090a 100644 --- a/Editor/AlicizaX.UI.Extension.Editor.asmdef +++ b/Editor/AlicizaX.UI.Extension.Editor.asmdef @@ -5,8 +5,7 @@ "GUID:6546d7765b4165b40850b3667f981c26", "GUID:6055be8ebefd69e48b49212b09b47b2f", "GUID:760f1778adc613f49a4394fb41ff0bbc", - "GUID:75b6f2078d190f14dbda4a5b747d709c", - "GUID:acfef7cabed3b0a42b25edb1cd4fa259" + "GUID:75b6f2078d190f14dbda4a5b747d709c" ], "includePlatforms": [ "Editor" @@ -17,6 +16,17 @@ "precompiledReferences": [], "autoReferenced": true, "defineConstraints": [], - "versionDefines": [], + "versionDefines": [ + { + "name": "com.unity.ugui", + "expression": "2.0.0", + "define": "TEXTMESHPRO_SUPPORT" + }, + { + "name": "com.unity.textmeshpro", + "expression": "", + "define": "TEXTMESHPRO_SUPPORT" + } + ], "noEngineReferences": false } \ No newline at end of file diff --git a/Editor/UX/UXTextMeshProEditor.cs b/Editor/UX/UXTextMeshProEditor.cs index 4fab8e4..eb4aed6 100644 --- a/Editor/UX/UXTextMeshProEditor.cs +++ b/Editor/UX/UXTextMeshProEditor.cs @@ -1,6 +1,6 @@ +#if TEXTMESHPRO_SUPPORT + using UnityEditor; - - namespace UnityEngine.UI { [CustomEditor(typeof(UXTextMeshPro), true)] @@ -30,3 +30,4 @@ namespace UnityEngine.UI } } } +#endif diff --git a/Runtime/AlicizaX.UI.Extension.asmdef b/Runtime/AlicizaX.UI.Extension.asmdef index 1d461fa..303ebcc 100644 --- a/Runtime/AlicizaX.UI.Extension.asmdef +++ b/Runtime/AlicizaX.UI.Extension.asmdef @@ -3,7 +3,6 @@ "rootNamespace": "AlicizaX.UI.Extension", "references": [ "GUID:6055be8ebefd69e48b49212b09b47b2f", - "GUID:75b6f2078d190f14dbda4a5b747d709c", "GUID:80ecb87cae9c44d19824e70ea7229748" ], "includePlatforms": [], @@ -13,6 +12,22 @@ "precompiledReferences": [], "autoReferenced": true, "defineConstraints": [], - "versionDefines": [], + "versionDefines": [ + { + "name": "com.unity.ugui", + "expression": "2.0.0", + "define": "TEXTMESHPRO_SUPPORT" + }, + { + "name": "com.unity.textmeshpro", + "expression": "", + "define": "TEXTMESHPRO_SUPPORT" + }, + { + "name": "com.kyrylokuzyk.primetween", + "expression": "1.2.1", + "define": "PRIMETWEEN_SUPPORT" + } + ], "noEngineReferences": false } \ No newline at end of file diff --git a/Runtime/RecyclerView/Scroller/ScrollbarEx.cs b/Runtime/RecyclerView/Scroller/ScrollbarEx.cs index f2266de..641f10c 100644 --- a/Runtime/RecyclerView/Scroller/ScrollbarEx.cs +++ b/Runtime/RecyclerView/Scroller/ScrollbarEx.cs @@ -1,5 +1,4 @@ using System; -using PrimeTween; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.UI; @@ -35,11 +34,19 @@ namespace AlicizaX.UI.RecyclerView if (scrollbar.direction == Scrollbar.Direction.TopToBottom || scrollbar.direction == Scrollbar.Direction.BottomToTop) { - Tween.ScaleX(handle, 1f, 0.2f); +#if PRIMETWEEN_SUPPORT + PrimeTween.Tween.ScaleX(handle, 1f, 0.2f); +#else + handle.localScale = new Vector3(1,handle.localScale.y,handle.localScale.z); +#endif } else { - Tween.ScaleY(handle, 1f, 0.2f); +#if PRIMETWEEN_SUPPORT + PrimeTween.Tween.ScaleY(handle, 1f, 0.2f); +#else + handle.localScale = new Vector3(handle.localScale.x,1,handle.localScale.z); +#endif } } @@ -52,11 +59,20 @@ namespace AlicizaX.UI.RecyclerView if (scrollbar.direction == Scrollbar.Direction.TopToBottom || scrollbar.direction == Scrollbar.Direction.BottomToTop) { - Tween.ScaleX(handle, 2f, 0.2f); +#if PRIMETWEEN_SUPPORT + PrimeTween.Tween.ScaleX(handle, 2f, 0.2f); +#else + handle.localScale = new Vector3(2,handle.localScale.y,handle.localScale.z); +#endif } else { - Tween.ScaleY(handle, 2f, 0.2f); +#if PRIMETWEEN_SUPPORT + PrimeTween.Tween.ScaleY(handle, 2f, 0.2f); +#else + handle.localScale = new Vector3(handle.localScale.x, 2, handle.localScale.z); +#endif + } } @@ -68,11 +84,19 @@ namespace AlicizaX.UI.RecyclerView if (scrollbar.direction == Scrollbar.Direction.TopToBottom || scrollbar.direction == Scrollbar.Direction.BottomToTop) { - Tween.ScaleX(handle, 1f, 0.2f); +#if PRIMETWEEN_SUPPORT + PrimeTween.Tween.ScaleX(handle, 1f, 0.2f); +#else + handle.localScale = new Vector3(1,handle.localScale.y,handle.localScale.z); +#endif } else { - Tween.ScaleY(handle, 1f, 0.2f); +#if PRIMETWEEN_SUPPORT + PrimeTween.Tween.ScaleY(handle, 1f, 0.2f); +#else + handle.localScale = new Vector3(handle.localScale.x,1,handle.localScale.z); +#endif } } } diff --git a/Runtime/UXComponent/Text/UXTextMeshPro.cs b/Runtime/UXComponent/Text/UXTextMeshPro.cs index da39d82..69d2383 100644 --- a/Runtime/UXComponent/Text/UXTextMeshPro.cs +++ b/Runtime/UXComponent/Text/UXTextMeshPro.cs @@ -1,4 +1,5 @@ -using System; +#if TEXTMESHPRO_SUPPORT + using TMPro; namespace UnityEngine.UI @@ -33,3 +34,5 @@ namespace UnityEngine.UI } } } + +#endif