diff --git a/Module/Advertising/Editor/AdSettingsEditor.cs b/Module/Advertising/Editor/AdSettingsEditor.cs index 638313a..461525b 100644 --- a/Module/Advertising/Editor/AdSettingsEditor.cs +++ b/Module/Advertising/Editor/AdSettingsEditor.cs @@ -24,6 +24,7 @@ public class AdSettingsEditor : Editor private SerializedProperty _admobInterstitialAdUnit; private SerializedProperty _admobRewardAdUnit; private SerializedProperty _admobRewardedInterstitialAdUnit; + private SerializedProperty _admobNativeOverlayAdUnit; private SerializedProperty _admobAppOpenAdUnit; private SerializedProperty _admobEnableTestMode; private SerializedProperty _enableGDPR; @@ -57,6 +58,7 @@ void Initialize() _admobRewardAdUnit = serializedObject.FindProperty("admobRewardAdUnit"); _admobRewardedInterstitialAdUnit = serializedObject.FindProperty("admobRewardedInterstitialAdUnit"); _admobAppOpenAdUnit = serializedObject.FindProperty("admobAppOpenAdUnit"); + _admobNativeOverlayAdUnit = serializedObject.FindProperty("admobNativeOverlayAdUnit"); _admobEnableTestMode = serializedObject.FindProperty("admobEnableTestMode"); _enableGDPR = serializedObject.FindProperty("enableGDPR"); _enableGDPRTestMode = serializedObject.FindProperty("enableGDPRTestMode"); @@ -140,6 +142,7 @@ void DrawAdmob() EditorGUILayout.PropertyField(_admobRewardAdUnit); EditorGUILayout.PropertyField(_admobRewardedInterstitialAdUnit); EditorGUILayout.PropertyField(_admobAppOpenAdUnit); + EditorGUILayout.PropertyField(_admobNativeOverlayAdUnit); EditorGUILayout.PropertyField(_admobEnableTestMode); EditorGUILayout.PropertyField(_admobDevicesTest); GUILayout.Space(10); diff --git a/Module/Advertising/Runtime/Admob/AdmobBannerAdUnit.cs b/Module/Advertising/Runtime/Admob/AdmobBannerAdUnit.cs index f008fd1..50bb487 100644 --- a/Module/Advertising/Runtime/Admob/AdmobBannerAdUnit.cs +++ b/Module/Advertising/Runtime/Admob/AdmobBannerAdUnit.cs @@ -13,8 +13,8 @@ namespace VirtueSky.Ads [Serializable] public class AdmobBannerAdUnit : AdUnit { - public BannerSize size = BannerSize.Adaptive; - public BannerPosition position = BannerPosition.Bottom; + public AdsSize size = AdsSize.Adaptive; + public AdsPosition position = AdsPosition.Bottom; public bool useCollapsible; public bool useTestId; #if VIRTUESKY_ADS && VIRTUESKY_ADMOB @@ -137,12 +137,12 @@ public AdSize ConvertSize() { switch (size) { - case BannerSize.Adaptive: + case AdsSize.Adaptive: return AdSize.GetCurrentOrientationAnchoredAdaptiveBannerAdSizeWithWidth( AdSize.FullWidth); - case BannerSize.MediumRectangle: return AdSize.MediumRectangle; - case BannerSize.Leaderboard: return AdSize.Leaderboard; - case BannerSize.IABBanner: return AdSize.IABBanner; + case AdsSize.MediumRectangle: return AdSize.MediumRectangle; + case AdsSize.Leaderboard: return AdSize.Leaderboard; + case AdsSize.IABBanner: return AdSize.IABBanner; //case BannerSize.SmartBanner: return AdSize.SmartBanner; default: return AdSize.Banner; } @@ -158,23 +158,23 @@ public AdPosition ConvertPosition() { switch (position) { - case BannerPosition.Top: return AdPosition.Top; - case BannerPosition.Bottom: return AdPosition.Bottom; - case BannerPosition.TopLeft: return AdPosition.TopLeft; - case BannerPosition.TopRight: return AdPosition.TopRight; - case BannerPosition.BottomLeft: return AdPosition.BottomLeft; - case BannerPosition.BottomRight: return AdPosition.BottomRight; + case AdsPosition.Top: return AdPosition.Top; + case AdsPosition.Bottom: return AdPosition.Bottom; + case AdsPosition.TopLeft: return AdPosition.TopLeft; + case AdsPosition.TopRight: return AdPosition.TopRight; + case AdsPosition.BottomLeft: return AdPosition.BottomLeft; + case AdsPosition.BottomRight: return AdPosition.BottomRight; default: return AdPosition.Bottom; } } public string ConvertPlacementCollapsible() { - if (position == BannerPosition.Top) + if (position == AdsPosition.Top) { return "top"; } - else if (position == BannerPosition.Bottom) + else if (position == AdsPosition.Bottom) { return "bottom"; } diff --git a/Module/Advertising/Runtime/Admob/AdmobClient.cs b/Module/Advertising/Runtime/Admob/AdmobClient.cs index 223258c..1428cd7 100644 --- a/Module/Advertising/Runtime/Admob/AdmobClient.cs +++ b/Module/Advertising/Runtime/Admob/AdmobClient.cs @@ -36,14 +36,23 @@ public override void Initialize() AdSettings.AdmobRewardAdUnit.Init(); AdSettings.AdmobRewardedInterstitialAdUnit.Init(); AdSettings.AdmobAppOpenAdUnit.Init(); + AdSettings.AdmobNativeOverlayAdUnit.Init(); RegisterAppStateChange(); LoadInterstitial(); LoadRewarded(); LoadRewardedInterstitial(); LoadAppOpen(); + LoadNativeOverlay(); #endif } + void LoadNativeOverlay() + { + if (!AdSettings.AdmobNativeOverlayAdUnit.IsReady()) + { + AdSettings.AdmobNativeOverlayAdUnit.Load(); + } + } #if VIRTUESKY_ADS && VIRTUESKY_ADMOB public void RegisterAppStateChange() diff --git a/Module/Advertising/Runtime/Admob/AdmobNativeOverlayAdUnit.cs b/Module/Advertising/Runtime/Admob/AdmobNativeOverlayAdUnit.cs new file mode 100644 index 0000000..7c682b9 --- /dev/null +++ b/Module/Advertising/Runtime/Admob/AdmobNativeOverlayAdUnit.cs @@ -0,0 +1,322 @@ +using System; +using System.Collections; +#if VIRTUESKY_ADS && VIRTUESKY_ADMOB +using GoogleMobileAds.Api; +using VirtueSky.Core; +using VirtueSky.Misc; +#endif +using UnityEngine; +using VirtueSky.Tracking; +using VirtueSky.Inspector; + +namespace VirtueSky.Ads +{ + [Serializable] + public class AdmobNativeOverlayAdUnit : AdUnit + { + public enum NativeTemplate + { + Small, + Medium + } + + [SerializeField] private bool useTestId; +#if VIRTUESKY_ADS && VIRTUESKY_ADMOB + [HeaderLine("Native Options", false), SerializeField] + private AdChoicesPlacement adChoicesPlacement; + + [SerializeField] private MediaAspectRatio mediaAspectRatio; + [SerializeField] private VideoOptions videoOptions; + + [HeaderLine("NativeAd Style", false)] public NativeTemplate nativeTemplate; + public Color mainBackgroundColor = Color.white; + public AdsSize adsSize = AdsSize.MediumRectangle; + public AdsPosition adsPosition = AdsPosition.Bottom; + + private NativeOverlayAd _nativeOverlayAd; +#endif + private readonly WaitForSeconds _waitReload = new WaitForSeconds(5); + private IEnumerator _reload; + + /// + /// Init ads and register callback tracking revenue + /// + public override void Init() + { + if (useTestId) GetUnitTest(); +#if VIRTUESKY_ADS && VIRTUESKY_ADMOB + if (AdStatic.IsRemoveAd || string.IsNullOrEmpty(Id)) return; + paidedCallback += AppTracking.TrackRevenue; +#endif + } + + /// + /// Load ads + /// + public override void Load() + { +#if VIRTUESKY_ADS && VIRTUESKY_ADMOB + if (AdStatic.IsRemoveAd || string.IsNullOrEmpty(Id)) return; + if (_nativeOverlayAd != null) Destroy(); + var adRequest = new AdRequest(); + var option = new NativeAdOptions + { + AdChoicesPlacement = adChoicesPlacement, + MediaAspectRatio = mediaAspectRatio, + VideoOptions = videoOptions + }; + NativeOverlayAd.Load(Id, adRequest, option, AdLoadCallback); +#endif + } + + /// + /// Check native overlay is ready + /// + /// If true then native overlay ads ready + public override bool IsReady() + { +#if VIRTUESKY_ADS && VIRTUESKY_ADMOB + return _nativeOverlayAd != null; +#else + return false; +#endif + } + + protected override void ShowImpl() + { +#if VIRTUESKY_ADS && VIRTUESKY_ADMOB + if (_nativeOverlayAd != null) _nativeOverlayAd.Show(); +#endif + } + + /// + /// Destroy native overlay ads + /// + public override void Destroy() + { +#if VIRTUESKY_ADS && VIRTUESKY_ADMOB + if (_nativeOverlayAd != null) + { + _nativeOverlayAd.Destroy(); + _nativeOverlayAd = null; + } +#endif + } + + /// + /// Hide native overlay ads + /// + public void Hide() + { +#if VIRTUESKY_ADS && VIRTUESKY_ADMOB + if (_nativeOverlayAd != null) _nativeOverlayAd.Hide(); +#endif + } + + /// + /// Render native overlay ads default + /// + public void RenderAd() + { +#if VIRTUESKY_ADS && VIRTUESKY_ADS + if (_nativeOverlayAd == null) return; + _nativeOverlayAd.RenderTemplate(Style(), ConvertSize(), ConvertPosition()); +#endif + } + + /// + /// Render native ads according to uiElement, use canvas overlay + /// + /// RectTransform of uiElement, used to determine position for native overlay ads + public void RenderAd(RectTransform uiElement) + { +#if VIRTUESKY_ADS && VIRTUESKY_ADS + if (_nativeOverlayAd == null) return; + var screenPosition = uiElement.ToWorldPosition(); + + float dpi = Screen.dpi / 160f; + var admobX = (int)(screenPosition.x / dpi); + var admobY = (int)((Screen.height - (int)screenPosition.y) / dpi); + _nativeOverlayAd.RenderTemplate(Style(), admobX, admobY); +#endif + } + + /// + /// Render native ads according to uiElement, use canvas overlay + /// + /// RectTransform of uiElement, used to determine position for native overlay ads + /// Custom width for native overlay ads + /// Custom height for native overlay ads + public void RenderAd(RectTransform uiElement, int width, int height) + { +#if VIRTUESKY_ADS && VIRTUESKY_ADS + if (_nativeOverlayAd == null) return; + var screenPosition = uiElement.ToWorldPosition(); + + float dpi = Screen.dpi / 160f; + var admobX = (int)(screenPosition.x / dpi); + var admobY = (int)((Screen.height - (int)screenPosition.y) / dpi); + _nativeOverlayAd.RenderTemplate(Style(), new AdSize(width, height), admobX, admobY); +#endif + } + + /// + /// Render native ads according to uiElement, use canvas screen-space camera + /// Can use position and size of uiElement for native overlay ads + /// + /// RectTransform of uiElement, used to determine position for native overlay ads + /// Canvas containing camera render uiElement + public void RenderAd(RectTransform uiElement, Canvas canvas, bool useSizeUiElement = true) + { +#if VIRTUESKY_ADS && VIRTUESKY_ADMOB + if (_nativeOverlayAd == null) return; + var worldPosition = uiElement.TransformPoint(uiElement.position); + Vector2 screenPosition = canvas.worldCamera.WorldToScreenPoint(worldPosition); + + float dpi = Screen.dpi / 160f; + var admobX = (int)((screenPosition.x - (uiElement.rect.width / 2)) / dpi); + var admobY = (int)(((Screen.height - (int)screenPosition.y) - (uiElement.rect.height / 2)) / dpi); + if (useSizeUiElement) + { + _nativeOverlayAd?.RenderTemplate(Style(), new AdSize((int)uiElement.rect.width, (int)uiElement.rect.height), admobX, admobY); + } + else + { + _nativeOverlayAd?.RenderTemplate(Style(), admobX, admobY); + } +#endif + } + + /// + /// Render native ads according to uiElement, use canvas screen-space camera + /// Can use position of uiElement and custom size for native overlay ads + /// + /// RectTransform of uiElement, used to determine position for native overlay ads + /// Canvas containing camera render uiElement + /// Custom width for native overlay ads + /// Custom height for native overlay ads + public void RenderAd(RectTransform uiElement, Canvas canvas, int width, int height) + { +#if VIRTUESKY_ADS && VIRTUESKY_ADMOB + if (_nativeOverlayAd == null) return; + var worldPosition = uiElement.TransformPoint(uiElement.position); + Vector2 screenPosition = canvas.worldCamera.WorldToScreenPoint(worldPosition); + + float dpi = Screen.dpi / 160f; + var admobX = (int)((screenPosition.x - width / 2) / dpi); + var admobY = (int)(((Screen.height - (int)screenPosition.y) - height / 2) / dpi); + _nativeOverlayAd?.RenderTemplate(Style(), new AdSize(width, height), admobX, admobY); +#endif + } + +#if VIRTUESKY_ADS && VIRTUESKY_ADMOB + NativeTemplateStyle Style() + { + return new NativeTemplateStyle + { + TemplateId = nativeTemplate.ToString().ToLower(), + MainBackgroundColor = mainBackgroundColor + }; + } + + AdPosition ConvertPosition() + { + return adsPosition switch + { + AdsPosition.Top => AdPosition.Top, + AdsPosition.Bottom => AdPosition.Bottom, + AdsPosition.TopLeft => AdPosition.TopLeft, + AdsPosition.TopRight => AdPosition.TopRight, + AdsPosition.BottomLeft => AdPosition.BottomLeft, + AdsPosition.BottomRight => AdPosition.BottomRight, + _ => AdPosition.Center + }; + } + + AdSize ConvertSize() + { + return adsSize switch + { + AdsSize.Banner => AdSize.Banner, + AdsSize.MediumRectangle => AdSize.MediumRectangle, + AdsSize.IABBanner => AdSize.IABBanner, + AdsSize.Leaderboard => AdSize.Leaderboard, + _ => AdSize.MediumRectangle, + }; + } + + private void AdLoadCallback(NativeOverlayAd ad, LoadAdError error) + { + if (error != null || ad == null) + { + OnAdFailedToLoad(error); + return; + } + + _nativeOverlayAd = ad; + _nativeOverlayAd.OnAdPaid += OnAdPaided; + _nativeOverlayAd.OnAdClicked += OnAdClicked; + _nativeOverlayAd.OnAdFullScreenContentOpened += OnAdOpening; + _nativeOverlayAd.OnAdFullScreenContentClosed += OnAdClosed; + OnAdLoaded(); + } + + private void OnAdLoaded() + { + Common.CallActionAndClean(ref loadedCallback); + OnLoadAdEvent?.Invoke(); + } + + private void OnAdClosed() + { + Common.CallActionAndClean(ref closedCallback); + OnClosedAdEvent?.Invoke(); + } + + private void OnAdOpening() + { + Common.CallActionAndClean(ref displayedCallback); + OnDisplayedAdEvent?.Invoke(); + } + + private void OnAdClicked() + { + Common.CallActionAndClean(ref clickedCallback); + OnClickedAdEvent?.Invoke(); + } + + private void OnAdPaided(AdValue value) + { + paidedCallback?.Invoke(value.Value / 1000000f, + "Admob", + Id, + "NativeOverlayAd", AdNetwork.Admob.ToString()); + } + + private void OnAdFailedToLoad(LoadAdError error) + { + Common.CallActionAndClean(ref failedToLoadCallback); + OnFailedToLoadAdEvent?.Invoke(error.GetMessage()); + if (_reload != null) App.StopCoroutine(_reload); + _reload = DelayReload(); + App.StartCoroutine(_reload); + } + + private IEnumerator DelayReload() + { + yield return _waitReload; + Load(); + } +#endif + + + void GetUnitTest() + { +#if UNITY_ANDROID + androidId = "ca-app-pub-3940256099942544/2247696110"; +#elif UNITY_IOS + iOSId = "ca-app-pub-3940256099942544/3986624511"; +#endif + } + } +} \ No newline at end of file diff --git a/Module/Advertising/Runtime/Admob/AdmobNativeOverlayAdUnit.cs.meta b/Module/Advertising/Runtime/Admob/AdmobNativeOverlayAdUnit.cs.meta new file mode 100644 index 0000000..5e9416c --- /dev/null +++ b/Module/Advertising/Runtime/Admob/AdmobNativeOverlayAdUnit.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 37f139dad3694ea88972289d6cde1cd6 +timeCreated: 1733279468 \ No newline at end of file diff --git a/Module/Advertising/Runtime/General/AdClient.cs b/Module/Advertising/Runtime/General/AdClient.cs index 9da6985..8aea6d3 100644 --- a/Module/Advertising/Runtime/General/AdClient.cs +++ b/Module/Advertising/Runtime/General/AdClient.cs @@ -126,5 +126,26 @@ public AdUnit BannerAdUnit() } #endregion + + #region Native Overlay Ad + + // Native overlay only for admob + public AdUnit NativeOverlayAdUnit() + { + return AdSettings.AdmobNativeOverlayAdUnit; + } + + protected virtual bool IsNativeOverlayAdReady() + { + return NativeOverlayAdUnit().IsReady(); + } + + public virtual void LoadNativeOverlayAd() + { + if (NativeOverlayAdUnit() == null) return; + if (!IsNativeOverlayAdReady()) NativeOverlayAdUnit().Load(); + } + + #endregion } } \ No newline at end of file diff --git a/Module/Advertising/Runtime/General/AdSettings.cs b/Module/Advertising/Runtime/General/AdSettings.cs index e535ef9..4d8df28 100644 --- a/Module/Advertising/Runtime/General/AdSettings.cs +++ b/Module/Advertising/Runtime/General/AdSettings.cs @@ -50,6 +50,7 @@ public class AdSettings : ScriptableSettings [SerializeField] private AdmobRewardAdUnit admobRewardAdUnit; [SerializeField] private AdmobRewardedInterstitialAdUnit admobRewardedInterstitialAdUnit; [SerializeField] private AdmobAppOpenAdUnit admobAppOpenAdUnit; + [SerializeField] private AdmobNativeOverlayAdUnit admobNativeOverlayAdUnit; [SerializeField] private bool admobEnableTestMode; [SerializeField] private List admobDevicesTest; @@ -59,6 +60,7 @@ public class AdSettings : ScriptableSettings public static AdmobRewardAdUnit AdmobRewardAdUnit => Instance.admobRewardAdUnit; public static AdmobRewardedInterstitialAdUnit AdmobRewardedInterstitialAdUnit => Instance.admobRewardedInterstitialAdUnit; public static AdmobAppOpenAdUnit AdmobAppOpenAdUnit => Instance.admobAppOpenAdUnit; + public static AdmobNativeOverlayAdUnit AdmobNativeOverlayAdUnit => Instance.admobNativeOverlayAdUnit; public static bool AdmobEnableTestMode => Instance.admobEnableTestMode; public static List AdmobDevicesTest => Instance.admobDevicesTest; @@ -136,7 +138,7 @@ public enum AdNetwork IronSource } - public enum BannerPosition + public enum AdsPosition { Top = 1, Bottom = 0, @@ -144,9 +146,10 @@ public enum BannerPosition TopRight = 3, BottomLeft = 4, BottomRight = 5, + Center = 6 } - public enum BannerSize + public enum AdsSize { Banner = 0, // 320x50 Adaptive = 5, // full width diff --git a/Module/Advertising/Runtime/General/Advertising.cs b/Module/Advertising/Runtime/General/Advertising.cs index 6a4ff00..605df4f 100644 --- a/Module/Advertising/Runtime/General/Advertising.cs +++ b/Module/Advertising/Runtime/General/Advertising.cs @@ -34,6 +34,7 @@ public class Advertising : MonoBehaviour private static event Func OnGetRewardAdEvent; private static event Func OnGetRewardInterEvent; private static event Func OnGetAppOpenAdEvent; + private static event Func OnGetNativeOverlayEvent; private static event Func OnInitAdClientEvent; private static event Action OnLoadAndShowGdprEvent; private static event Action OnShowGdprAgainEvent; @@ -46,6 +47,7 @@ private void OnEnable() OnGetRewardAdEvent += GetRewardAdUnit; OnGetRewardInterEvent += GetRewardInterAdUnit; OnGetAppOpenAdEvent += GetAppOpenAdUnit; + OnGetNativeOverlayEvent += GetNativeOverlayAdUnit; OnInitAdClientEvent += InternalIsInitAdClient; #if VIRTUESKY_ADMOB OnLoadAndShowGdprEvent += LoadAndShowConsentForm; @@ -60,6 +62,7 @@ private void OnDisable() OnGetRewardAdEvent -= GetRewardAdUnit; OnGetRewardInterEvent -= GetRewardInterAdUnit; OnGetAppOpenAdEvent -= GetAppOpenAdUnit; + OnGetNativeOverlayEvent -= GetNativeOverlayAdUnit; OnInitAdClientEvent -= InternalIsInitAdClient; #if VIRTUESKY_ADMOB OnLoadAndShowGdprEvent -= LoadAndShowConsentForm; @@ -283,6 +286,7 @@ private void ShowPrivacyOptionsForm() private AdUnit GetRewardAdUnit() => currentAdClient.RewardAdUnit(); private AdUnit GetRewardInterAdUnit() => currentAdClient.RewardedInterstitialAdUnit(); private AdUnit GetAppOpenAdUnit() => currentAdClient.AppOpenAdUnit(); + private AdUnit GetNativeOverlayAdUnit() => currentAdClient.NativeOverlayAdUnit(); private bool InternalIsInitAdClient() => isInitAdClient; #endregion @@ -294,6 +298,7 @@ private void ShowPrivacyOptionsForm() public static AdUnit RewardAd => OnGetRewardAdEvent?.Invoke(); public static AdUnit RewardedInterstitialAd => OnGetRewardInterEvent?.Invoke(); public static AdUnit AppOpenAd => OnGetAppOpenAdEvent?.Invoke(); + public static AdUnit NativeOverlayAd => OnGetNativeOverlayEvent?.Invoke(); public static bool IsInitAdClient => (bool)OnInitAdClientEvent?.Invoke(); #if VIRTUESKY_ADMOB diff --git a/Module/Advertising/Runtime/IronSource/IronSourceBannerAdUnit.cs b/Module/Advertising/Runtime/IronSource/IronSourceBannerAdUnit.cs index c224ca9..91a762c 100644 --- a/Module/Advertising/Runtime/IronSource/IronSourceBannerAdUnit.cs +++ b/Module/Advertising/Runtime/IronSource/IronSourceBannerAdUnit.cs @@ -7,8 +7,8 @@ namespace VirtueSky.Ads [Serializable] public class IronSourceBannerAdUnit : AdUnit { - public BannerSize size; - public BannerPosition position; + public AdsSize size; + public AdsPosition position; private bool _isBannerDestroyed = true; private bool _isBannerShowing; private bool _previousBannerShowStatus; @@ -31,7 +31,7 @@ public override void Load() #if VIRTUESKY_ADS && VIRTUESKY_IRONSOURCE if (AdStatic.IsRemoveAd) return; var bannerSize = ConvertBannerSize(); - if (size == BannerSize.Adaptive) bannerSize.SetAdaptive(true); + if (size == AdsSize.Adaptive) bannerSize.SetAdaptive(true); if (_isBannerDestroyed) { IronSource.Agent.loadBanner(bannerSize, ConvertBannerPosition()); @@ -110,10 +110,10 @@ private IronSourceBannerSize ConvertBannerSize() { switch (size) { - case BannerSize.Banner: return IronSourceBannerSize.BANNER; - case BannerSize.Adaptive: return IronSourceBannerSize.BANNER; - case BannerSize.MediumRectangle: return IronSourceBannerSize.RECTANGLE; - case BannerSize.Leaderboard: return IronSourceBannerSize.LARGE; + case AdsSize.Banner: return IronSourceBannerSize.BANNER; + case AdsSize.Adaptive: return IronSourceBannerSize.BANNER; + case AdsSize.MediumRectangle: return IronSourceBannerSize.RECTANGLE; + case AdsSize.Leaderboard: return IronSourceBannerSize.LARGE; default: return IronSourceBannerSize.BANNER; } } @@ -122,8 +122,8 @@ private IronSourceBannerPosition ConvertBannerPosition() { switch (position) { - case BannerPosition.Bottom: return IronSourceBannerPosition.BOTTOM; - case BannerPosition.Top: return IronSourceBannerPosition.TOP; + case AdsPosition.Bottom: return IronSourceBannerPosition.BOTTOM; + case AdsPosition.Top: return IronSourceBannerPosition.TOP; default: return IronSourceBannerPosition.BOTTOM; } } diff --git a/Module/Advertising/Runtime/Max/MaxBannerAdUnit.cs b/Module/Advertising/Runtime/Max/MaxBannerAdUnit.cs index 4befd36..3e803ed 100644 --- a/Module/Advertising/Runtime/Max/MaxBannerAdUnit.cs +++ b/Module/Advertising/Runtime/Max/MaxBannerAdUnit.cs @@ -7,8 +7,8 @@ namespace VirtueSky.Ads [Serializable] public class MaxBannerAdUnit : AdUnit { - public BannerSize size = BannerSize.Banner; - public BannerPosition position = BannerPosition.Bottom; + public AdsSize size = AdsSize.Banner; + public AdsPosition position = AdsPosition.Bottom; private bool _isBannerDestroyed = true; private bool _isBannerShowing; @@ -25,7 +25,7 @@ public override void Init() MaxSdkCallbacks.Banner.OnAdCollapsedEvent += OnAdCollapsed; MaxSdkCallbacks.Banner.OnAdRevenuePaidEvent += OnAdRevenuePaid; MaxSdkCallbacks.Banner.OnAdClickedEvent += OnAdClicked; - if (size != BannerSize.Adaptive) + if (size != AdsSize.Adaptive) { MaxSdk.SetBannerExtraParameter(Id, "adaptive_banner", "false"); } @@ -104,12 +104,12 @@ public MaxSdkBase.BannerPosition ConvertPosition() { switch (position) { - case BannerPosition.Top: return MaxSdkBase.BannerPosition.TopCenter; - case BannerPosition.Bottom: return MaxSdkBase.BannerPosition.BottomCenter; - case BannerPosition.TopLeft: return MaxSdkBase.BannerPosition.TopLeft; - case BannerPosition.TopRight: return MaxSdkBase.BannerPosition.TopRight; - case BannerPosition.BottomLeft: return MaxSdkBase.BannerPosition.BottomLeft; - case BannerPosition.BottomRight: return MaxSdkBase.BannerPosition.BottomRight; + case AdsPosition.Top: return MaxSdkBase.BannerPosition.TopCenter; + case AdsPosition.Bottom: return MaxSdkBase.BannerPosition.BottomCenter; + case AdsPosition.TopLeft: return MaxSdkBase.BannerPosition.TopLeft; + case AdsPosition.TopRight: return MaxSdkBase.BannerPosition.TopRight; + case AdsPosition.BottomLeft: return MaxSdkBase.BannerPosition.BottomLeft; + case AdsPosition.BottomRight: return MaxSdkBase.BannerPosition.BottomRight; default: return MaxSdkBase.BannerPosition.BottomCenter; } diff --git a/Module/Component/FollowTargetComponent.cs b/Module/Component/FollowTargetComponent.cs index b3754d5..d795a1c 100644 --- a/Module/Component/FollowTargetComponent.cs +++ b/Module/Component/FollowTargetComponent.cs @@ -34,31 +34,65 @@ public class FollowTargetComponent : BaseMono ShowIf(nameof(typeFollowTarget), TypeFollowTarget.SmoothDamp), SerializeField] private float maxSpeed = Mathf.Infinity; + public Transform TargetTransform + { + get => targetTrans; + set => targetTrans = value; + } - private void Awake() + public Vector3 OffsetTrans { - if (currentTrans == null) - { - currentTrans = gameObject.transform; - } + get => offsetTrans; + set => offsetTrans = value; + } - offsetTrans = currentTrans.position - targetTrans.position; + public DirectionFollowTarget DirectionFollowTarget + { + get => directionFollowTarget; + set => directionFollowTarget = value; } - public void SetTarget(Transform t) + public TypeFollowTarget TypeFollowTarget { - targetTrans = t; + get => typeFollowTarget; + set => typeFollowTarget = value; } - public void SetDirectionFollowTarget(DirectionFollowTarget d) + public float InterpolateValue { - directionFollowTarget = d; + get => interpolateValue; + set => interpolateValue = value; } - public void SetTypeFollowTarget(TypeFollowTarget t) + public Vector3 CurrentVelocity { - typeFollowTarget = t; + get => currentVelocity; + set => currentVelocity = value; + } + + public float SmoothTime + { + get => smoothTime; + set => smoothTime = value; + } + + public float MaxSpeed + { + get => maxSpeed; + set => maxSpeed = value; + } + + + private void Awake() + { + if (currentTrans == null) + { + currentTrans = gameObject.transform; + } + + offsetTrans = currentTrans.position - targetTrans.position; } + public override void LateTick() { diff --git a/Module/ControlPanel/ConstantPackage.cs b/Module/ControlPanel/ConstantPackage.cs index a581ae5..8ee7941 100644 --- a/Module/ControlPanel/ConstantPackage.cs +++ b/Module/ControlPanel/ConstantPackage.cs @@ -2,7 +2,7 @@ { public class ConstantPackage { - public const string VersionUnityCommon = "1.4.6"; + public const string VersionUnityCommon = "1.4.7"; public const string PackageNameInAppPurchase = "com.unity.purchasing"; public const string MaxVersionInAppPurchase = "4.12.2"; public const string PackageNameNewtonsoftJson = "com.unity.nuget.newtonsoft-json"; diff --git a/Module/PrimeTween/Editor/AssemblyInfo.cs.meta b/Module/PrimeTween/Editor/AssemblyInfo.cs.meta index b825c58..7ed2f24 100644 --- a/Module/PrimeTween/Editor/AssemblyInfo.cs.meta +++ b/Module/PrimeTween/Editor/AssemblyInfo.cs.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: a3c27f8cb2a846f589acacc063d08498 +guid: 77f31680944e5534e8ed7d89b9d6a99a timeCreated: 1683538561 \ No newline at end of file diff --git a/Module/PrimeTween/Editor/CodeGenerator.asset.meta b/Module/PrimeTween/Editor/CodeGenerator.asset.meta index 0702eb7..8b2d7c5 100644 --- a/Module/PrimeTween/Editor/CodeGenerator.asset.meta +++ b/Module/PrimeTween/Editor/CodeGenerator.asset.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: b7964af3ed0024db49a5758e8a4de1c6 +guid: 5b5aaa5611b385541ab2b0cb1d8755e1 NativeFormatImporter: externalObjects: {} mainObjectFileID: 11400000 diff --git a/Module/PrimeTween/Editor/CodeGenerator.cs b/Module/PrimeTween/Editor/CodeGenerator.cs index d44d57c..0b16493 100644 --- a/Module/PrimeTween/Editor/CodeGenerator.cs +++ b/Module/PrimeTween/Editor/CodeGenerator.cs @@ -304,6 +304,7 @@ internal static (PropType, Type) TweenTypeToTweenData(TweenType tweenType) { (TweenType.ShakeLocalRotation, PropType.Quaternion, typeof(Transform)), (TweenType.ShakeScale, PropType.Vector3, typeof(Transform)), (TweenType.ShakeCustom, PropType.Vector3, typeof(Transform)), + (TweenType.ShakeCamera, PropType.Float, typeof(Camera)), (TweenType.CustomFloat, PropType.Float, null), (TweenType.CustomColor, PropType.Color, null), (TweenType.CustomVector2, PropType.Vector2, null), diff --git a/Module/PrimeTween/Editor/CodeGenerator.cs.meta b/Module/PrimeTween/Editor/CodeGenerator.cs.meta index 38d5027..adc3321 100644 --- a/Module/PrimeTween/Editor/CodeGenerator.cs.meta +++ b/Module/PrimeTween/Editor/CodeGenerator.cs.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: f81c141b47ab4aee9ea1454818ce73d3 +guid: 91062890830ba3f44ae278f19424d5ad timeCreated: 1673348438 \ No newline at end of file diff --git a/Module/PrimeTween/Editor/CodeTemplates.cs.meta b/Module/PrimeTween/Editor/CodeTemplates.cs.meta index f01230a..beaef6e 100644 --- a/Module/PrimeTween/Editor/CodeTemplates.cs.meta +++ b/Module/PrimeTween/Editor/CodeTemplates.cs.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: 566b3920ae914b24909cd26d64c86e77 +guid: 13ce4156fb592254ab2f13dd0ab0bf52 timeCreated: 1677166276 \ No newline at end of file diff --git a/Module/PrimeTween/Editor/PrimeTweenManagerInspector.cs.meta b/Module/PrimeTween/Editor/PrimeTweenManagerInspector.cs.meta index fb4ed9f..46c8d37 100644 --- a/Module/PrimeTween/Editor/PrimeTweenManagerInspector.cs.meta +++ b/Module/PrimeTween/Editor/PrimeTweenManagerInspector.cs.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: 98b4466711c04e95b1d84f31e10116ba +guid: 7c9dce2090ecb50459c38684398a3adb timeCreated: 1683813842 \ No newline at end of file diff --git a/Module/PrimeTween/Editor/TweenSettingsPropDrawer.cs b/Module/PrimeTween/Editor/TweenSettingsPropDrawer.cs index aa0b5f6..84e1275 100644 --- a/Module/PrimeTween/Editor/TweenSettingsPropDrawer.cs +++ b/Module/PrimeTween/Editor/TweenSettingsPropDrawer.cs @@ -1,3 +1,4 @@ +using System; using JetBrains.Annotations; using PrimeTween; using UnityEditor; @@ -56,30 +57,30 @@ public override void OnGUI(Rect position, [NotNull] SerializedProperty property, internal static void DrawDuration(Rect rect, [NotNull] SerializedProperty property) { if (GUI.enabled) { - if (property.floatValue == 0f) { - property.floatValue = 1f; - } else if (property.floatValue < 0) { - property.floatValue = 0.01f; - } + ClampProperty(property, 1f); } PropertyField(rect, property); } + internal static void ClampProperty(SerializedProperty prop, float defaultValue, float min = 0.01f, float max = float.MaxValue) { + prop.floatValue = prop.floatValue == 0f ? defaultValue : Mathf.Clamp(prop.floatValue, min, max); + } + internal static void drawEaseTillEnd([NotNull] SerializedProperty property, ref Rect rect) { DrawEaseAndCycles(property, ref rect); drawStartDelayTillEnd(ref rect, property); } - internal static void DrawEaseAndCycles(SerializedProperty property, ref Rect rect, bool addSpace = true) { + internal static void DrawEaseAndCycles(SerializedProperty property, ref Rect rect, bool addSpace = true, bool draw = true) { { // ease property.NextVisible(true); - PropertyField(rect, property); + if (draw) PropertyField(rect, property); moveToNextLine(ref rect); // customEase bool isCustom = property.intValue == (int) Ease.Custom; property.NextVisible(true); if (isCustom) { - PropertyField(rect, property); + if (draw) PropertyField(rect, property); moveToNextLine(ref rect); } } @@ -87,13 +88,13 @@ internal static void DrawEaseAndCycles(SerializedProperty property, ref Rect rec rect.y += standardVerticalSpacing * 2; } { // cycles - var cycles = drawCycles(rect, property); + var cycles = drawCycles(rect, property, draw); moveToNextLine(ref rect); { // cycleMode property.NextVisible(true); if (cycles != 0 && cycles != 1) { - PropertyField(rect, property); + if (draw) PropertyField(rect, property); moveToNextLine(ref rect); } } @@ -123,14 +124,14 @@ internal static void drawStartDelayTillEnd(ref Rect rect, [NotNull] SerializedPr } } - internal static int drawCycles(Rect rect, [NotNull] SerializedProperty property) { + internal static int drawCycles(Rect rect, [NotNull] SerializedProperty property, bool draw = true) { property.NextVisible(false); if (property.intValue == 0) { property.intValue = 1; } else if (property.intValue < -1) { property.intValue = -1; } - PropertyField(rect, property); + if (draw) PropertyField(rect, property); return property.intValue; } diff --git a/Module/PrimeTween/Editor/TweenSettingsPropDrawer.cs.meta b/Module/PrimeTween/Editor/TweenSettingsPropDrawer.cs.meta index 26faeed..a179809 100644 --- a/Module/PrimeTween/Editor/TweenSettingsPropDrawer.cs.meta +++ b/Module/PrimeTween/Editor/TweenSettingsPropDrawer.cs.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: 142499da0ff44fac99f2ac376bbce331 +guid: f8f4d614305226a4abf7d56ed174e508 timeCreated: 1677570253 \ No newline at end of file diff --git a/Module/PrimeTween/Editor/TweenSettingsTypesPropDrawer.cs.meta b/Module/PrimeTween/Editor/TweenSettingsTypesPropDrawer.cs.meta index 21bad29..e4c7e09 100644 --- a/Module/PrimeTween/Editor/TweenSettingsTypesPropDrawer.cs.meta +++ b/Module/PrimeTween/Editor/TweenSettingsTypesPropDrawer.cs.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: 9e0988c54c7744db9aa91eae79ed7e5e +guid: f5dfc251024fd904d945310438915610 timeCreated: 1677747774 \ No newline at end of file diff --git a/Module/PrimeTween/Editor/TweenShakeSettingsPropDrawer.cs b/Module/PrimeTween/Editor/TweenShakeSettingsPropDrawer.cs index 1a7ee08..e868d84 100644 --- a/Module/PrimeTween/Editor/TweenShakeSettingsPropDrawer.cs +++ b/Module/PrimeTween/Editor/TweenShakeSettingsPropDrawer.cs @@ -6,7 +6,7 @@ using static UnityEditor.EditorGUIUtility; [CustomPropertyDrawer(typeof(ShakeSettings))] -internal class TweenShakeSettingsPropDrawer : PropertyDrawer { +internal class TweenShakeSettingsPropDrawer : PropertyDrawer { // todo rename to ShakeSettingsPropDrawer public override float GetPropertyHeight([NotNull] SerializedProperty property, GUIContent label) { if (!property.isExpanded) { return singleLineHeight; diff --git a/Module/PrimeTween/Editor/TweenShakeSettingsPropDrawer.cs.meta b/Module/PrimeTween/Editor/TweenShakeSettingsPropDrawer.cs.meta index ee61c16..6f042fb 100644 --- a/Module/PrimeTween/Editor/TweenShakeSettingsPropDrawer.cs.meta +++ b/Module/PrimeTween/Editor/TweenShakeSettingsPropDrawer.cs.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: ccef20e0855347cdae977a49716d656f +guid: c4cf2c2465d1a5940b94c9560c2a879f timeCreated: 1677573071 \ No newline at end of file diff --git a/Module/PrimeTween/Editor/ValueContainerStartEndPropDrawer.cs b/Module/PrimeTween/Editor/ValueContainerStartEndPropDrawer.cs index fbb9fb8..fcc4030 100644 --- a/Module/PrimeTween/Editor/ValueContainerStartEndPropDrawer.cs +++ b/Module/PrimeTween/Editor/ValueContainerStartEndPropDrawer.cs @@ -7,11 +7,14 @@ public class ValueContainerStartEndPropDrawer : PropertyDrawer { public override float GetPropertyHeight(SerializedProperty prop, GUIContent label) { prop.Next(true); - var propType = Utils.TweenTypeToTweenData((TweenType)prop.enumValueIndex).Item1; - if (propType == PropType.None) { - return 0f; - } + var tweenType = (TweenType)prop.enumValueIndex; prop.Next(false); + return GetHeight(prop, label, tweenType); + } + + internal static float GetHeight(SerializedProperty prop, GUIContent label, TweenType tweenType) { + var propType = Utils.TweenTypeToTweenData(tweenType).Item1; + Assert.AreNotEqual(PropType.None, propType); bool startFromCurrent = prop.boolValue; bool hasStartValue = !startFromCurrent; if (hasStartValue) { @@ -49,16 +52,18 @@ SerializedPropertyType ToSerializedPropType() { public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label) { prop.Next(true); - var propType = Utils.TweenTypeToTweenData((TweenType)prop.enumValueIndex).Item1; - if (propType == PropType.None) { - return; - } + var tweenType = (TweenType)prop.enumValueIndex; prop.Next(false); + Draw(ref pos, prop, tweenType); + } + internal static void Draw(ref Rect pos, SerializedProperty prop, TweenType tweenType) { + var propType = Utils.TweenTypeToTweenData(tweenType).Item1; + Assert.AreNotEqual(PropType.None, propType); const float toggleWidth = 18f; EditorGUIUtility.labelWidth -= toggleWidth; var togglePos = new Rect(pos.x + 2, pos.y, toggleWidth - 2, EditorGUIUtility.singleLineHeight); - var guiContent = EditorGUI.BeginProperty(togglePos, new GUIContent(), prop); + var guiContent = EditorGUI.BeginProperty(togglePos, new GUIContent(), prop); // todo is it possible to display tooltip? tooltip is only displayed over the label, but I need to display it over the ToggleLeft EditorGUI.BeginChangeCheck(); bool newStartFromCurrent = !EditorGUI.ToggleLeft(togglePos, guiContent, !prop.boolValue); if (EditorGUI.EndChangeCheck()) { @@ -68,12 +73,11 @@ public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label) pos.x += toggleWidth; pos.width -= toggleWidth; + prop.Next(false); if (newStartFromCurrent) { pos.height = EditorGUIUtility.singleLineHeight; - using (new EditorGUI.DisabledScope(false)) { - EditorGUI.LabelField(pos, new GUIContent(prop.displayName, prop.tooltip)); - } + EditorGUI.LabelField(pos, new GUIContent(prop.displayName, prop.tooltip)); prop.Next(false); } else { DrawValueContainer(ref pos, prop, propType); @@ -81,6 +85,10 @@ public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label) pos.y += pos.height + EditorGUIUtility.standardVerticalSpacing; DrawValueContainer(ref pos, prop, propType); + pos.y += pos.height + EditorGUIUtility.standardVerticalSpacing; + + pos.x -= toggleWidth; + pos.width += toggleWidth; } static void DrawValueContainer(ref Rect pos, SerializedProperty prop, PropType propType) { @@ -107,7 +115,7 @@ ValueContainer DrawField(Rect position) { case PropType.Vector3: return EditorGUI.Vector3Field(position, guiContent, valueContainer.Vector3Val).ToContainer(); case PropType.Vector4: - case PropType.Quaternion: + case PropType.Quaternion: // todo don't draw quaternion return EditorGUI.Vector4Field(position, guiContent, valueContainer.Vector4Val).ToContainer(); case PropType.Rect: return EditorGUI.RectField(position, guiContent, valueContainer.RectVal).ToContainer(); diff --git a/Module/PrimeTween/Editor/ValueContainerStartEndPropDrawer.cs.meta b/Module/PrimeTween/Editor/ValueContainerStartEndPropDrawer.cs.meta index 4ab8b2b..51e748d 100644 --- a/Module/PrimeTween/Editor/ValueContainerStartEndPropDrawer.cs.meta +++ b/Module/PrimeTween/Editor/ValueContainerStartEndPropDrawer.cs.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: 6c08ff7f819145b987090598c6a13397 +guid: f165141ebcaf41e4ea0f7b0b044542b3 timeCreated: 1710625562 \ No newline at end of file diff --git a/Module/PrimeTween/Runtime/Easing.cs.meta b/Module/PrimeTween/Runtime/Easing.cs.meta index f5453fe..253e319 100644 --- a/Module/PrimeTween/Runtime/Easing.cs.meta +++ b/Module/PrimeTween/Runtime/Easing.cs.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: 5d7874887c74422a835daf3c70912dcf +guid: 0d15a36c09227af4a8b87a62c526710b timeCreated: 1695050976 \ No newline at end of file diff --git a/Module/PrimeTween/Runtime/Internal.meta b/Module/PrimeTween/Runtime/Internal.meta index b5665c6..e5f9448 100644 --- a/Module/PrimeTween/Runtime/Internal.meta +++ b/Module/PrimeTween/Runtime/Internal.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: 7e94f642418940748d478b3f5e1a2cf7 +guid: 3df97bf12b41bc0409245d60fe7ac4a4 timeCreated: 1677165257 \ No newline at end of file diff --git a/Module/PrimeTween/Runtime/Internal/AssemblyInfo.cs.meta b/Module/PrimeTween/Runtime/Internal/AssemblyInfo.cs.meta index dc44667..1c6e838 100644 --- a/Module/PrimeTween/Runtime/Internal/AssemblyInfo.cs.meta +++ b/Module/PrimeTween/Runtime/Internal/AssemblyInfo.cs.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: 61f306d3fcd147d6819d3c8d1ec82489 +guid: 58f810eb1f699af42b88d44af5580099 timeCreated: 1674163732 \ No newline at end of file diff --git a/Module/PrimeTween/Runtime/Internal/Assert.cs.meta b/Module/PrimeTween/Runtime/Internal/Assert.cs.meta index cb671b4..008f0b7 100644 --- a/Module/PrimeTween/Runtime/Internal/Assert.cs.meta +++ b/Module/PrimeTween/Runtime/Internal/Assert.cs.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: c593ca227a744d37b174fc677404e1a9 +guid: ae72793d7d769434fb6654f624e0d743 timeCreated: 1686059830 \ No newline at end of file diff --git a/Module/PrimeTween/Runtime/Internal/AsyncAwaitSupport.cs b/Module/PrimeTween/Runtime/Internal/AsyncAwaitSupport.cs index b74db85..45de3bc 100644 --- a/Module/PrimeTween/Runtime/Internal/AsyncAwaitSupport.cs +++ b/Module/PrimeTween/Runtime/Internal/AsyncAwaitSupport.cs @@ -38,7 +38,7 @@ public void OnCompleted([NotNull] Action continuation) { var wait = animate(tween.tween, ref infiniteSettings, t => { if (t._isAlive) { var target = t.target as ReusableTween; - if (t.intParam != target.id) { + if (t.longParam != target.id || !target._isAlive) { t.ForceComplete(); } } diff --git a/Module/PrimeTween/Runtime/Internal/AsyncAwaitSupport.cs.meta b/Module/PrimeTween/Runtime/Internal/AsyncAwaitSupport.cs.meta index c9a778c..2e2c716 100644 --- a/Module/PrimeTween/Runtime/Internal/AsyncAwaitSupport.cs.meta +++ b/Module/PrimeTween/Runtime/Internal/AsyncAwaitSupport.cs.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: 3aad1100da5540a191e769695ce94322 +guid: bb010708e48fbe340bff3f70eebffdcf timeCreated: 1678262334 \ No newline at end of file diff --git a/Module/PrimeTween/Runtime/Internal/Constants.cs b/Module/PrimeTween/Runtime/Internal/Constants.cs index 12e238b..01b1486 100644 --- a/Module/PrimeTween/Runtime/Internal/Constants.cs +++ b/Module/PrimeTween/Runtime/Internal/Constants.cs @@ -17,7 +17,11 @@ internal static string buildWarningCanBeDisabledMessage(string settingName) { internal const string isDeadMessage = "Tween/Sequence is not alive. Please check the 'isAlive' property before calling this API.\n"; internal const string unscaledTimeTooltip = "The tween will use real time, ignoring Time.timeScale."; + internal const string easeTooltip = "The easing curve of an animation.\n\n" + + "Default is Ease." + nameof(Ease.OutQuad) + ". The Default ease can be modified via '" + nameof(PrimeTweenConfig) + "." + nameof(PrimeTweenConfig.defaultEase) + "' setting.\n\n" + + "Set to " + nameof(Ease) + "." + nameof(Ease.Custom) + " to control the easing with custom " + nameof(AnimationCurve) + "."; internal const string cyclesTooltip = "Setting cycles to -1 will repeat the tween indefinitely."; + internal const string cycleModeTooltip = "See the documentation of each cycle mode by hoovering the dropdown."; internal const string defaultCtorError = "Tween or Sequence is not created properly.\n" + "- Use Sequence." + nameof(Sequence.Create) + "() to start a Sequence.\n" + "- Use static 'Tween.' methods to start a Tween.\n"; diff --git a/Module/PrimeTween/Runtime/Internal/Constants.cs.meta b/Module/PrimeTween/Runtime/Internal/Constants.cs.meta index e897b48..8876661 100644 --- a/Module/PrimeTween/Runtime/Internal/Constants.cs.meta +++ b/Module/PrimeTween/Runtime/Internal/Constants.cs.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: 60bd878528e14f21ae03c089de19f253 +guid: 7d2ab94679b58654cbfc1b98c24eb89c timeCreated: 1677010307 \ No newline at end of file diff --git a/Module/PrimeTween/Runtime/Internal/CoroutinesSupport.cs b/Module/PrimeTween/Runtime/Internal/CoroutinesSupport.cs index e56a6b4..042d092 100644 --- a/Module/PrimeTween/Runtime/Internal/CoroutinesSupport.cs +++ b/Module/PrimeTween/Runtime/Internal/CoroutinesSupport.cs @@ -64,11 +64,11 @@ object IEnumerator.Current { } internal class TweenCoroutineEnumerator : IEnumerator { - Tween tween; + internal Tween tween; bool isRunning; internal void SetTween(Tween _tween) { - Assert.IsFalse(isRunning); + Assert.IsFalse(isRunning); // todo turn to error? Assert.IsTrue(!tween.IsCreated || tween.id == _tween.id); Assert.IsTrue(_tween.isAlive); tween = _tween; @@ -83,14 +83,18 @@ bool IEnumerator.MoveNext() { return result; } - internal void resetEnumerator() { - tween = default; - isRunning = false; + internal bool resetEnumerator() { + if (tween.IsCreated) { + tween = default; + isRunning = false; + return true; + } + return false; } object IEnumerator.Current { get { - Assert.IsTrue(tween.isAlive); + Assert.IsTrue(tween.isAlive); // todo throws if debugger is attached Assert.IsTrue(isRunning); return null; } diff --git a/Module/PrimeTween/Runtime/Internal/CoroutinesSupport.cs.meta b/Module/PrimeTween/Runtime/Internal/CoroutinesSupport.cs.meta index 8bcee2e..3d8cb4f 100644 --- a/Module/PrimeTween/Runtime/Internal/CoroutinesSupport.cs.meta +++ b/Module/PrimeTween/Runtime/Internal/CoroutinesSupport.cs.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: 6b4374d6f2544e95a115ca74b92bec0c +guid: 0c3310f69bd0ea548af51ff19b127d27 timeCreated: 1678282601 \ No newline at end of file diff --git a/Module/PrimeTween/Runtime/Internal/DOTweenAdapter.meta b/Module/PrimeTween/Runtime/Internal/DOTweenAdapter.meta index f811048..31bcee4 100644 --- a/Module/PrimeTween/Runtime/Internal/DOTweenAdapter.meta +++ b/Module/PrimeTween/Runtime/Internal/DOTweenAdapter.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: 7e46be11dbfe47849bc893876e4b3011 +guid: b316fd2e021e99848ba03d579f441b4b timeCreated: 1675753203 \ No newline at end of file diff --git a/Module/PrimeTween/Runtime/Internal/DOTweenAdapter/DOTweenAdapter.cs.meta b/Module/PrimeTween/Runtime/Internal/DOTweenAdapter/DOTweenAdapter.cs.meta index 331ff4d..7bed85b 100644 --- a/Module/PrimeTween/Runtime/Internal/DOTweenAdapter/DOTweenAdapter.cs.meta +++ b/Module/PrimeTween/Runtime/Internal/DOTweenAdapter/DOTweenAdapter.cs.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: f2642faa77224669a504c829da9b8d90 +guid: 5fce049859d454043842bf904db8d698 timeCreated: 1675686833 \ No newline at end of file diff --git a/Module/PrimeTween/Runtime/Internal/DOTweenAdapter/DOTweenAdapterGenerated.cs.meta b/Module/PrimeTween/Runtime/Internal/DOTweenAdapter/DOTweenAdapterGenerated.cs.meta index d1ca182..9ac88e4 100644 --- a/Module/PrimeTween/Runtime/Internal/DOTweenAdapter/DOTweenAdapterGenerated.cs.meta +++ b/Module/PrimeTween/Runtime/Internal/DOTweenAdapter/DOTweenAdapterGenerated.cs.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: 3c238e2b584a4987b714406da2cf9c56 +guid: 69fc3e1f971153441ae050fc68b9220c timeCreated: 1675754085 \ No newline at end of file diff --git a/Module/PrimeTween/Runtime/Internal/Extensions.cs.meta b/Module/PrimeTween/Runtime/Internal/Extensions.cs.meta index 1653550..50480fa 100644 --- a/Module/PrimeTween/Runtime/Internal/Extensions.cs.meta +++ b/Module/PrimeTween/Runtime/Internal/Extensions.cs.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: af006e099ef04f6aa7cecc43e8cb6097 +guid: d9e2e1d7a00c85642a00f247c7e80d17 timeCreated: 1677165403 \ No newline at end of file diff --git a/Module/PrimeTween/Runtime/Internal/ITween.cs.meta b/Module/PrimeTween/Runtime/Internal/ITween.cs.meta index 3b1f60a..6b40892 100644 --- a/Module/PrimeTween/Runtime/Internal/ITween.cs.meta +++ b/Module/PrimeTween/Runtime/Internal/ITween.cs.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: 3cd334e55fa448c3a55e6c14ebaf6638 +guid: 98f6c14cc912d5a4daa4050d4b593ce3 timeCreated: 1701681398 \ No newline at end of file diff --git a/Module/PrimeTween/Runtime/Internal/Obsolete.cs.meta b/Module/PrimeTween/Runtime/Internal/Obsolete.cs.meta index 721bb9d..37e1126 100644 --- a/Module/PrimeTween/Runtime/Internal/Obsolete.cs.meta +++ b/Module/PrimeTween/Runtime/Internal/Obsolete.cs.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: e6abe1297f08438d974455dc4b2f5396 +guid: 4af956d8a2ea39541902ec77a7f84714 timeCreated: 1693407269 \ No newline at end of file diff --git a/Module/PrimeTween/Runtime/Internal/PrimeTweenManager.cs b/Module/PrimeTween/Runtime/Internal/PrimeTweenManager.cs index 3167d4e..a25f9da 100644 --- a/Module/PrimeTween/Runtime/Internal/PrimeTweenManager.cs +++ b/Module/PrimeTween/Runtime/Internal/PrimeTweenManager.cs @@ -162,7 +162,8 @@ void update(List tweens, float deltaTime, float unscaledDeltaTime } #endif // ReSharper disable once PossibleNullReferenceException - if (tween.updateAndCheckIfRunning(tween.settings.useUnscaledTime ? unscaledDeltaTime : deltaTime)) { + // delay release for one frame if coroutineEnumerator.resetEnumerator() + if (tween.updateAndCheckIfRunning(tween.settings.useUnscaledTime ? unscaledDeltaTime : deltaTime) || tween.coroutineEnumerator.resetEnumerator()) { if (i != newIndex) { tweens[i] = null; tweens[newIndex] = tween; diff --git a/Module/PrimeTween/Runtime/Internal/PrimeTweenManager.cs.meta b/Module/PrimeTween/Runtime/Internal/PrimeTweenManager.cs.meta index ea264f3..bae4f18 100644 --- a/Module/PrimeTween/Runtime/Internal/PrimeTweenManager.cs.meta +++ b/Module/PrimeTween/Runtime/Internal/PrimeTweenManager.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: f3f57bce977c474ba249eb63545eff3c +guid: 5ad66649102498443a587bf23ba0e252 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Module/PrimeTween/Runtime/Internal/PropType.cs.meta b/Module/PrimeTween/Runtime/Internal/PropType.cs.meta index 766fda2..87ee424 100644 --- a/Module/PrimeTween/Runtime/Internal/PropType.cs.meta +++ b/Module/PrimeTween/Runtime/Internal/PropType.cs.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: 4eb6f75d186a4c3e88cdf4a5b2b36332 +guid: 1d4f1f1cb8407c94fb68028614c5b25d timeCreated: 1674162838 \ No newline at end of file diff --git a/Module/PrimeTween/Runtime/Internal/ReusableTween.cs b/Module/PrimeTween/Runtime/Internal/ReusableTween.cs index f574a0c..e8aca04 100644 --- a/Module/PrimeTween/Runtime/Internal/ReusableTween.cs +++ b/Module/PrimeTween/Runtime/Internal/ReusableTween.cs @@ -744,6 +744,7 @@ internal void EmergencyStop(bool isTargetDestroyed = false) { } mainSequence = parent; } + Assert.IsTrue(mainSequence.isAlive); Assert.IsTrue(mainSequence.root.tween.isMainSequenceRoot()); mainSequence.emergencyStop(); } else if (_isAlive) { @@ -766,7 +767,7 @@ internal void kill() { } void revive() { - // Debug.Log($"[{Time.frameCount}] revive {GetDescription()}"); + // print($"revive {GetDescription()}"); Assert.IsFalse(_isAlive); _isAlive = true; #if UNITY_EDITOR diff --git a/Module/PrimeTween/Runtime/Internal/ReusableTween.cs.meta b/Module/PrimeTween/Runtime/Internal/ReusableTween.cs.meta index 4e3e384..45d1b23 100644 --- a/Module/PrimeTween/Runtime/Internal/ReusableTween.cs.meta +++ b/Module/PrimeTween/Runtime/Internal/ReusableTween.cs.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: 257a3dcfeff44807bbedf9be546b410d +guid: f3e8c1c374b78c8468173c1c377165ed timeCreated: 1676595389 \ No newline at end of file diff --git a/Module/PrimeTween/Runtime/Internal/StackTraces.cs.meta b/Module/PrimeTween/Runtime/Internal/StackTraces.cs.meta index b73aca4..fadf2c6 100644 --- a/Module/PrimeTween/Runtime/Internal/StackTraces.cs.meta +++ b/Module/PrimeTween/Runtime/Internal/StackTraces.cs.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: 7a28f74456ca46d08fc316235384c5ee +guid: 731d618fd47d4d84687095e4dd58a867 timeCreated: 1703321204 \ No newline at end of file diff --git a/Module/PrimeTween/Runtime/Internal/StandardEasing.cs.meta b/Module/PrimeTween/Runtime/Internal/StandardEasing.cs.meta index ded7f93..b033bf3 100644 --- a/Module/PrimeTween/Runtime/Internal/StandardEasing.cs.meta +++ b/Module/PrimeTween/Runtime/Internal/StandardEasing.cs.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: e7f65c344edd417ebef88555406178af +guid: ac5ad1796b7ea7e4fbfae7197ed609f1 timeCreated: 1673270662 \ No newline at end of file diff --git a/Module/PrimeTween/Runtime/Internal/TweenGenerated.cs b/Module/PrimeTween/Runtime/Internal/TweenGenerated.cs index cffa87a..fd376a9 100644 --- a/Module/PrimeTween/Runtime/Internal/TweenGenerated.cs +++ b/Module/PrimeTween/Runtime/Internal/TweenGenerated.cs @@ -21,6 +21,7 @@ internal enum TweenType { ShakeLocalRotation, ShakeScale, ShakeCustom, + ShakeCamera, CustomFloat, CustomColor, diff --git a/Module/PrimeTween/Runtime/Internal/TweenGenerated.cs.meta b/Module/PrimeTween/Runtime/Internal/TweenGenerated.cs.meta index 0e433cf..503eedb 100644 --- a/Module/PrimeTween/Runtime/Internal/TweenGenerated.cs.meta +++ b/Module/PrimeTween/Runtime/Internal/TweenGenerated.cs.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: 51610f0e9d8e4ccead49e9fcc96d54e3 +guid: 4ac7b9d16652abb43a56e1131365ea37 timeCreated: 1673617985 \ No newline at end of file diff --git a/Module/PrimeTween/Runtime/Internal/TweenMethods.cs b/Module/PrimeTween/Runtime/Internal/TweenMethods.cs index 51a6e9c..5ae122d 100644 --- a/Module/PrimeTween/Runtime/Internal/TweenMethods.cs +++ b/Module/PrimeTween/Runtime/Internal/TweenMethods.cs @@ -421,7 +421,7 @@ static Tween AnimateTimeScale(Tween tween, TweenSettings settings, TweenT } var result = animate(tween.tween, ref settings, t => { var target = t.target as ReusableTween; - if (t.intParam != target.id) { + if (t.longParam != target.id || !target._isAlive) { t.EmergencyStop(); return; } diff --git a/Module/PrimeTween/Runtime/Internal/TweenMethods.cs.meta b/Module/PrimeTween/Runtime/Internal/TweenMethods.cs.meta index 0cf732b..138b14f 100644 --- a/Module/PrimeTween/Runtime/Internal/TweenMethods.cs.meta +++ b/Module/PrimeTween/Runtime/Internal/TweenMethods.cs.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: 964bf290d93964b8b9ab9ba1b3e231c7 +guid: 4b92226f9bf37474abfc8e8761a5a405 timeCreated: 1672225881 \ No newline at end of file diff --git a/Module/PrimeTween/Runtime/Internal/Utils.cs b/Module/PrimeTween/Runtime/Internal/Utils.cs index 6010a43..5e01698 100644 --- a/Module/PrimeTween/Runtime/Internal/Utils.cs +++ b/Module/PrimeTween/Runtime/Internal/Utils.cs @@ -214,6 +214,8 @@ internal static (PropType, Type) TweenTypeToTweenData(TweenType tweenType) { return (PropType.Vector3, typeof(UnityEngine.Transform)); case TweenType.ShakeCustom: return (PropType.Vector3, typeof(UnityEngine.Transform)); + case TweenType.ShakeCamera: + return (PropType.Float, typeof(UnityEngine.Camera)); case TweenType.CustomFloat: return (PropType.Float, null); case TweenType.CustomColor: diff --git a/Module/PrimeTween/Runtime/Internal/Utils.cs.meta b/Module/PrimeTween/Runtime/Internal/Utils.cs.meta index 9a0e5b6..1081248 100644 --- a/Module/PrimeTween/Runtime/Internal/Utils.cs.meta +++ b/Module/PrimeTween/Runtime/Internal/Utils.cs.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: 7f3bfd9524c14644bfbab698076886f3 +guid: 70d8fab0e50ec67439b58a6c9948545d timeCreated: 1711272020 \ No newline at end of file diff --git a/Module/PrimeTween/Runtime/Internal/ValueContainer.cs b/Module/PrimeTween/Runtime/Internal/ValueContainer.cs index 28123a0..f4971ca 100644 --- a/Module/PrimeTween/Runtime/Internal/ValueContainer.cs +++ b/Module/PrimeTween/Runtime/Internal/ValueContainer.cs @@ -7,10 +7,8 @@ namespace PrimeTween { internal struct ValueContainerStartEnd { [SerializeField] internal TweenType tweenType; // todo HideInInspector? [SerializeField, Tooltip(Constants.startFromCurrentTooltip)] internal bool startFromCurrent; - [Tooltip(Constants.startValueTooltip)] - [SerializeField] internal ValueContainer startValue; - [Tooltip(Constants.endValueTooltip)] - [SerializeField] internal ValueContainer endValue; + [SerializeField, Tooltip(Constants.startValueTooltip)] internal ValueContainer startValue; + [SerializeField, Tooltip(Constants.endValueTooltip)] internal ValueContainer endValue; } [Serializable, StructLayout(LayoutKind.Explicit)] diff --git a/Module/PrimeTween/Runtime/Internal/ValueContainer.cs.meta b/Module/PrimeTween/Runtime/Internal/ValueContainer.cs.meta index 70d5f69..25444cc 100644 --- a/Module/PrimeTween/Runtime/Internal/ValueContainer.cs.meta +++ b/Module/PrimeTween/Runtime/Internal/ValueContainer.cs.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: 483fe305105a484489884630559c0d62 +guid: e7b35fe033748b642889264ad634c8fc timeCreated: 1676455173 \ No newline at end of file diff --git a/Module/PrimeTween/Runtime/PrimeTweenConfig.cs.meta b/Module/PrimeTween/Runtime/PrimeTweenConfig.cs.meta index e231786..28dc7a3 100644 --- a/Module/PrimeTween/Runtime/PrimeTweenConfig.cs.meta +++ b/Module/PrimeTween/Runtime/PrimeTweenConfig.cs.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: 9a87535e581e4e4a85e83b154ee80edb +guid: 358ab55e20cf0ea479e29566e6c422b1 timeCreated: 1679991780 \ No newline at end of file diff --git a/Module/PrimeTween/Runtime/Sequence.cs b/Module/PrimeTween/Runtime/Sequence.cs index f562080..0dbe9be 100644 --- a/Module/PrimeTween/Runtime/Sequence.cs +++ b/Module/PrimeTween/Runtime/Sequence.cs @@ -172,7 +172,7 @@ void addLinkedReference(Tween tween) { Assert.IsFalse(tween.tween.prev.IsCreated); last.tween.next = tween; tween.tween.prev = last; - root.tween.intParam = 0; + root.tween.intParam = emptySequenceTag - emptySequenceTag; // set to 0 in a way to be able to search the code better } Tween getLast() { diff --git a/Module/PrimeTween/Runtime/Sequence.cs.meta b/Module/PrimeTween/Runtime/Sequence.cs.meta index 9834672..18db503 100644 --- a/Module/PrimeTween/Runtime/Sequence.cs.meta +++ b/Module/PrimeTween/Runtime/Sequence.cs.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: 8a2d3576d8ee453a9d515299e94e87bc +guid: 049d34d9c60b9a348982b241df76a064 timeCreated: 1675416609 \ No newline at end of file diff --git a/Module/PrimeTween/Runtime/Shake.cs b/Module/PrimeTween/Runtime/Shake.cs index 66c0980..4722784 100644 --- a/Module/PrimeTween/Runtime/Shake.cs +++ b/Module/PrimeTween/Runtime/Shake.cs @@ -16,11 +16,13 @@ public partial struct Tween { public static Sequence ShakeCamera([NotNull] Camera camera, float strengthFactor, float duration = 0.5f, float frequency = ShakeSettings.defaultFrequency, float startDelay = 0, float endDelay = 0, bool useUnscaledTime = PrimeTweenConfig.defaultUseUnscaledTimeForShakes) { var transform = camera.transform; if (camera.orthographic) { - var orthoPosStrength = strengthFactor * camera.orthographicSize * 0.03f; - return ShakeLocalPosition(transform, new ShakeSettings(new Vector3(orthoPosStrength, orthoPosStrength), duration, frequency, startDelay: startDelay, endDelay: endDelay, useUnscaledTime: useUnscaledTime)) + float orthoPosStrength = strengthFactor * camera.orthographicSize * 0.03f; + return Sequence.Create() + .Group(ShakeLocalPosition(transform, new ShakeSettings(new Vector3(orthoPosStrength, orthoPosStrength), duration, frequency, startDelay: startDelay, endDelay: endDelay, useUnscaledTime: useUnscaledTime))) .Group(ShakeLocalRotation(transform, new ShakeSettings(new Vector3(0, 0, strengthFactor * 0.6f), duration, frequency, startDelay: startDelay, endDelay: endDelay, useUnscaledTime: useUnscaledTime))); } - return Sequence.Create(ShakeLocalRotation(transform, new ShakeSettings(strengthFactor * Vector3.one, duration, frequency, startDelay: startDelay, endDelay: endDelay, useUnscaledTime: useUnscaledTime))); + return Sequence.Create() + .Group(ShakeLocalRotation(transform, new ShakeSettings(strengthFactor * Vector3.one, duration, frequency, startDelay: startDelay, endDelay: endDelay, useUnscaledTime: useUnscaledTime))); } public static Tween ShakeLocalPosition([NotNull] Transform target, Vector3 strength, float duration, float frequency = ShakeSettings.defaultFrequency, bool enableFalloff = true, Ease easeBetweenShakes = Ease.Default, float asymmetryFactor = 0f, int cycles = 1, diff --git a/Module/PrimeTween/Runtime/Shake.cs.meta b/Module/PrimeTween/Runtime/Shake.cs.meta index 8e7486b..0b147ad 100644 --- a/Module/PrimeTween/Runtime/Shake.cs.meta +++ b/Module/PrimeTween/Runtime/Shake.cs.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: 570c6fe2825b44d7adcb65883493f007 +guid: 9be3d88a4acbb44469970f31e8a15b1f timeCreated: 1677514909 \ No newline at end of file diff --git a/Module/PrimeTween/Runtime/ShakeSettings.cs.meta b/Module/PrimeTween/Runtime/ShakeSettings.cs.meta index 9b1f3f4..4143ce5 100644 --- a/Module/PrimeTween/Runtime/ShakeSettings.cs.meta +++ b/Module/PrimeTween/Runtime/ShakeSettings.cs.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: 06521c91fffc428a8de282cc2a0d7f01 +guid: 023b767872d4b10488fae4daf6dab34e timeCreated: 1674160114 \ No newline at end of file diff --git a/Module/PrimeTween/Runtime/Tween.cs b/Module/PrimeTween/Runtime/Tween.cs index a320188..e73b267 100644 --- a/Module/PrimeTween/Runtime/Tween.cs +++ b/Module/PrimeTween/Runtime/Tween.cs @@ -264,7 +264,7 @@ public void SetRemainingCycles(int cycles) { if (tween.tweenType == TweenType.Delay && tween.HasOnComplete) { Debug.LogError("Applying cycles to Delay will not repeat the OnComplete() callback, but instead will increase the Delay duration.\n" + "OnComplete() is called only once when ALL tween cycles complete. To repeat the OnComplete() callback, please use the Sequence.Create(cycles: numCycles) and put the tween inside a Sequence.\n" + - "More info: https://forum.unity.com/threads/1479609/page-3#post-9415922\n"); + "More info: https://discussions.unity.com/t/926420/101\n"); } if (cycles == -1) { tween.settings.cycles = -1; diff --git a/Module/PrimeTween/Runtime/Tween.cs.meta b/Module/PrimeTween/Runtime/Tween.cs.meta index c235ede..048af43 100644 --- a/Module/PrimeTween/Runtime/Tween.cs.meta +++ b/Module/PrimeTween/Runtime/Tween.cs.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: 5f913a3a034a4c42b75653a290884c42 +guid: 0e8dbd7bd7d248c448cd00fe0383c019 timeCreated: 1673432255 \ No newline at end of file diff --git a/Module/PrimeTween/Runtime/TweenSettings.cs b/Module/PrimeTween/Runtime/TweenSettings.cs index 994cdc2..a87ac6d 100644 --- a/Module/PrimeTween/Runtime/TweenSettings.cs +++ b/Module/PrimeTween/Runtime/TweenSettings.cs @@ -18,15 +18,13 @@ namespace PrimeTween { [Serializable] public struct TweenSettings { public float duration; - [Tooltip("The easing curve of an animation.\n\n" + - "Default is Ease." + nameof(Ease.OutQuad) + ". The Default ease can be modified via '" + nameof(PrimeTweenConfig) + "." + nameof(PrimeTweenConfig.defaultEase) + "' setting.\n\n" + - "Set to " + nameof(Ease) + "." + nameof(Ease.Custom) + " to control the easing with custom " + nameof(AnimationCurve) + ".")] + [Tooltip(Constants.easeTooltip)] public Ease ease; [Tooltip("A custom Animation Curve that will work as an easing curve.")] [CanBeNull] public AnimationCurve customEase; [Tooltip(Constants.cyclesTooltip)] public int cycles; - [Tooltip("See the documentation of each cycle mode by hoovering the dropdown.")] + [Tooltip(Constants.cycleModeTooltip)] public CycleMode cycleMode; [Tooltip(Constants.startDelayTooltip)] public float startDelay; diff --git a/Module/PrimeTween/Runtime/TweenSettings.cs.meta b/Module/PrimeTween/Runtime/TweenSettings.cs.meta index 3141281..91f5ada 100644 --- a/Module/PrimeTween/Runtime/TweenSettings.cs.meta +++ b/Module/PrimeTween/Runtime/TweenSettings.cs.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: a711147e8806494290f395316ea27b55 +guid: 7204690df6a5ef5448def73688fb61a6 timeCreated: 1673432104 \ No newline at end of file diff --git a/Module/PrimeTween/Runtime/TweenSettingsT.cs.meta b/Module/PrimeTween/Runtime/TweenSettingsT.cs.meta index 6c0c4b6..b5c8aa1 100644 --- a/Module/PrimeTween/Runtime/TweenSettingsT.cs.meta +++ b/Module/PrimeTween/Runtime/TweenSettingsT.cs.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: e2e695fd1b8540c287178353a35071e9 +guid: 22546e8240f5f474ca2f8c7e9980d442 timeCreated: 1683451931 \ No newline at end of file diff --git a/Module/PrimeTween/version.txt b/Module/PrimeTween/version.txt index 0408c30..24e56e0 100644 --- a/Module/PrimeTween/version.txt +++ b/Module/PrimeTween/version.txt @@ -1 +1 @@ -v1.2.0 \ No newline at end of file +v1.2.1 \ No newline at end of file diff --git a/README.md b/README.md index 97b2843..7acaabb 100644 --- a/README.md +++ b/README.md @@ -23,9 +23,9 @@ ### 1: Download the repo and drop it into folder `Assets` ### 2: Add the line below to `Packages/manifest.json` -for version `1.4.6` +for version `1.4.7` ```csharp -"com.wolf-org.sunflower2":"https://github.com/unity-package/sunflower_2.git#1.4.6", +"com.wolf-org.sunflower2":"https://github.com/unity-package/sunflower_2.git#1.4.7", ``` ## Includes modules diff --git a/package.json b/package.json index 268cd12..11e561c 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "com.wolf-org.sunflower2", "displayName": "Sunflower2", "description": "Core singleton for building Unity games ", - "version": "1.4.6", + "version": "1.4.7", "unity": "2022.3", "category": "virtuesky", "license": "MIT",