diff --git a/Scripts/UIParticleAttractor.cs b/Scripts/UIParticleAttractor.cs index 0bcd6a5..ab3c128 100644 --- a/Scripts/UIParticleAttractor.cs +++ b/Scripts/UIParticleAttractor.cs @@ -14,6 +14,12 @@ namespace Coffee.UIExtensions Smooth, Sphere, } + + public enum UpdateMode + { + Normal, + UnscaledTime, + } [SerializeField] private ParticleSystem m_ParticleSystem; @@ -33,6 +39,9 @@ namespace Coffee.UIExtensions [SerializeField] private Movement m_Movement; + [SerializeField] + private UpdateMode m_UpdateMode; + [SerializeField] private UnityEvent m_OnAttracted; @@ -84,6 +93,18 @@ namespace Coffee.UIExtensions } } + public UpdateMode updateMode + { + get + { + return m_UpdateMode; + } + set + { + m_UpdateMode = value; + } + } + public UnityEvent onAttracted { get @@ -221,6 +242,15 @@ namespace Coffee.UIExtensions private Vector3 GetAttractedPosition(Vector3 current, Vector3 target, float duration, float time) { var speed = m_MaxSpeed; + switch (m_UpdateMode) + { + case UpdateMode.Normal: + speed *= 60 * Time.deltaTime; + break; + case UpdateMode.UnscaledTime: + speed *= 60 * Time.unscaledDeltaTime; + break; + } switch (m_Movement) { case Movement.Linear: