diff --git a/VirtueSky/PrimeTween/Editor/CodeGenerator.cs b/VirtueSky/PrimeTween/Editor/CodeGenerator.cs index 01e49c10..d44d57c5 100644 --- a/VirtueSky/PrimeTween/Editor/CodeGenerator.cs +++ b/VirtueSky/PrimeTween/Editor/CodeGenerator.cs @@ -72,6 +72,7 @@ internal void generateAllMethods() { } const string generatorBeginLabel = "// CODE GENERATOR BEGIN"; + const string textMeshProScriptingDefine = "#if TEXT_MESH_PRO_INSTALLED || (UNITY_6000_0_OR_NEWER && UNITY_UGUI_INSTALLED)"; [ContextMenu(nameof(generateTweenComponent))] void generateTweenComponent() { @@ -105,9 +106,11 @@ void generateTweenComponent() { switch (dependency) { case Dependency.PRIME_TWEEN_EXPERIMENTAL: case Dependency.UI_ELEMENTS_MODULE_INSTALLED: - case Dependency.TEXT_MESH_PRO_INSTALLED: str += $" #if {dependency}\n"; break; + case Dependency.TEXT_MESH_PRO_INSTALLED: + str += $" {textMeshProScriptingDefine}\n"; + break; default: str += $" #if !UNITY_2019_1_OR_NEWER || {dependency}\n"; break; @@ -272,9 +275,11 @@ internal static (PropType, Type) TweenTypeToTweenData(TweenType tweenType) { switch (dependency) { case Dependency.PRIME_TWEEN_EXPERIMENTAL: case Dependency.UI_ELEMENTS_MODULE_INSTALLED: - case Dependency.TEXT_MESH_PRO_INSTALLED: utilsText += $" #if {dependency}\n"; break; + case Dependency.TEXT_MESH_PRO_INSTALLED: + utilsText += $" {textMeshProScriptingDefine}\n"; + break; default: utilsText += $" #if !UNITY_2019_1_OR_NEWER || {dependency}\n"; break; @@ -385,9 +390,11 @@ static string generateWithDefines([NotNull] Func g switch (dependency) { case Dependency.PRIME_TWEEN_EXPERIMENTAL: case Dependency.UI_ELEMENTS_MODULE_INSTALLED: - case Dependency.TEXT_MESH_PRO_INSTALLED: result += $"\n #if {dependency}"; break; + case Dependency.TEXT_MESH_PRO_INSTALLED: + result += $"\n {textMeshProScriptingDefine}"; + break; default: result += $"\n #if !UNITY_2019_1_OR_NEWER || {dependency}"; break; diff --git a/VirtueSky/PrimeTween/Runtime/Internal/DOTweenAdapter/DOTweenAdapterGenerated.cs b/VirtueSky/PrimeTween/Runtime/Internal/DOTweenAdapter/DOTweenAdapterGenerated.cs index 285cbd7d..1102e94e 100644 --- a/VirtueSky/PrimeTween/Runtime/Internal/DOTweenAdapter/DOTweenAdapterGenerated.cs +++ b/VirtueSky/PrimeTween/Runtime/Internal/DOTweenAdapter/DOTweenAdapterGenerated.cs @@ -148,7 +148,7 @@ public static partial class DOTweenAdapter { #endif #if UI_ELEMENTS_MODULE_INSTALLED #endif - #if TEXT_MESH_PRO_INSTALLED + #if TEXT_MESH_PRO_INSTALLED || (UNITY_6000_0_OR_NEWER && UNITY_UGUI_INSTALLED) public static Tween DOMaxVisibleCharacters([NotNull] this TMPro.TMP_Text target, int endValue, float duration) => Tween.TextMaxVisibleCharacters(target, endValue, duration); #endif diff --git a/VirtueSky/PrimeTween/Runtime/Internal/TweenGenerated.cs b/VirtueSky/PrimeTween/Runtime/Internal/TweenGenerated.cs index f3c5301c..cffa87a9 100644 --- a/VirtueSky/PrimeTween/Runtime/Internal/TweenGenerated.cs +++ b/VirtueSky/PrimeTween/Runtime/Internal/TweenGenerated.cs @@ -1751,7 +1751,7 @@ public static Tween VisualElementBackgroundColor([NotNull] UnityEngine.UIElement } #endif - #if TEXT_MESH_PRO_INSTALLED + #if TEXT_MESH_PRO_INSTALLED || (UNITY_6000_0_OR_NEWER && UNITY_UGUI_INSTALLED) public static Tween TextMaxVisibleCharacters([NotNull] TMPro.TMP_Text target, int endValue, float duration, Ease ease = Ease.Default, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) => TextMaxVisibleCharacters(target, new TweenSettings(endValue, new TweenSettings(duration, ease, cycles, cycleMode, startDelay, endDelay, useUnscaledTime))); public static Tween TextMaxVisibleCharacters([NotNull] TMPro.TMP_Text target, int endValue, float duration, Easing ease, int cycles = 1, CycleMode cycleMode = CycleMode.Restart, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = false) diff --git a/VirtueSky/PrimeTween/Runtime/Internal/TweenMethods.cs b/VirtueSky/PrimeTween/Runtime/Internal/TweenMethods.cs index 9837e425..372e9bdc 100644 --- a/VirtueSky/PrimeTween/Runtime/Internal/TweenMethods.cs +++ b/VirtueSky/PrimeTween/Runtime/Internal/TweenMethods.cs @@ -362,7 +362,7 @@ public static Tween Scale([NotNull] Transform target, TweenSettings unifo public static Tween Rotation([NotNull] Transform target, TweenSettings eulerAnglesSettings) => Rotation(target, toQuaternion(eulerAnglesSettings)); public static Tween LocalRotation([NotNull] Transform target, TweenSettings localEulerAnglesSettings) => LocalRotation(target, toQuaternion(localEulerAnglesSettings)); static TweenSettings toQuaternion(TweenSettings s) => new TweenSettings(Quaternion.Euler(s.startValue), Quaternion.Euler(s.endValue), s.settings) { startFromCurrent = s.startFromCurrent }; - #if TEXT_MESH_PRO_INSTALLED + #if TEXT_MESH_PRO_INSTALLED || (UNITY_6000_0_OR_NEWER && UNITY_UGUI_INSTALLED) public static Tween TextMaxVisibleCharacters([NotNull] TMPro.TMP_Text target, TweenSettings settings) { int oldCount = target.textInfo.characterCount; target.ForceMeshUpdate(); diff --git a/VirtueSky/PrimeTween/Runtime/Internal/Utils.cs b/VirtueSky/PrimeTween/Runtime/Internal/Utils.cs index c49b818a..9cb225a2 100644 --- a/VirtueSky/PrimeTween/Runtime/Internal/Utils.cs +++ b/VirtueSky/PrimeTween/Runtime/Internal/Utils.cs @@ -196,12 +196,16 @@ internal static (PropType, Type) TweenTypeToTweenData(TweenType tweenType) { case TweenType.VisualElementBackgroundColor: return (PropType.Color, typeof(UnityEngine.UIElements.VisualElement)); #endif - #if TEXT_MESH_PRO_INSTALLED + #if TEXT_MESH_PRO_INSTALLED || (UNITY_6000_0_OR_NEWER && UNITY_UGUI_INSTALLED) case TweenType.TextMaxVisibleCharacters: return (PropType.Int, typeof(TMPro.TMP_Text)); #endif case TweenType.None: return (PropType.None, null); + #if PRIME_TWEEN_PRO + case TweenType.TweenComponent: + return (PropType.None, typeof(PrimeTween.TweenComponent)); + #endif case TweenType.Delay: return (PropType.Float, null); case TweenType.Callback: diff --git a/VirtueSky/PrimeTween/version.txt b/VirtueSky/PrimeTween/version.txt index e54497df..ac0e3dac 100644 --- a/VirtueSky/PrimeTween/version.txt +++ b/VirtueSky/PrimeTween/version.txt @@ -1 +1 @@ -v1.1.18 \ No newline at end of file +v1.1.19 \ No newline at end of file