Пример #1
0
        /// <summary>
        /// Stops the tween.
        /// </summary>
        /// <param name="stopBehavior">The behavior to use to handle the stop.</param>
        public void Stop(TweenStopBehavior stopBehavior)
        {
            if (state != TweenState.Stopped)
            {
                state = TweenState.Stopped;
                if (stopBehavior == TweenStopBehavior.Complete)
                {
                    currentTime = duration;
                    UpdateValue();
                    if (completionCallback != null)
                    {
                        completionCallback.Invoke(this);
                        completionCallback = null;
                    }
                    if (continueWith != null)
                    {
                        continueWith.Start();

#if IS_UNITY
                        TweenFactory.AddTween(continueWith);
#else
                        // TODO: Implement your own continueWith handling
#endif

                        continueWith = null;
                    }
                }
            }
        }
Пример #2
0
 /// <summary>
 /// Stops the tween.
 /// </summary>
 /// <param name="stopBehavior">The behavior to use to handle the stop.</param>
 public void Stop(TweenStopBehavior stopBehavior)
 {
     if (state != TweenState.Stopped)
     {
         state = TweenState.Stopped;
         if (stopBehavior == TweenStopBehavior.Complete)
         {
             currentTime = duration;
             UpdateValue();
             if (completionCallback != null)
             {
                 completionCallback.Invoke(this);
                 completionCallback = null;
             }
             if (continueWith != null)
             {
                 continueWith.Start();
                 TweenFactory.AddTween(continueWith);
                 continueWith = null;
             }
         }
     }
 }