private BaseTween ProcessTween(BaseTween tween)
        {
            tween.SetOnComplete(delegate { tweens.Remove(tween); });
            tweens.Add(tween);

            return(tween);
        }
Esempio n. 2
0
 private static void AddTweenToPool(BaseTween tween)
 {
     if (tween is ValueTween)
     {
         valueTweens.Add(tween as ValueTween);
     }
     else if (tween is MoveTween)
     {
         moveTweens.Add(tween as MoveTween);
     }
     else if (tween is Vector2Tween)
     {
         vector2Tweens.Add(tween as Vector2Tween);
     }
     else if (tween is Vector3Tween)
     {
         vector3Tweens.Add(tween as Vector3Tween);
     }
     else if (tween is ColorTween)
     {
         colorTweens.Add(tween as ColorTween);
     }
     else if (tween is QuaternionTween)
     {
         quaternionTweens.Add(tween as QuaternionTween);
     }
 }
Esempio n. 3
0
 public void CancelTween(BaseTween tween)
 {
     if (tween != null)
     {
         CancelTween(tween.ID);
     }
 }
Esempio n. 4
0
        private BaseTween ProcessTween(BaseTween tween)
        {
            tween.SetOnComplete(delegate { m_tweens.Remove(tween); });
            m_tweens.Add(tween);

            EditorApplication.update = EditorUpdate;

            return(tween);
        }
Esempio n. 5
0
 private Command GetCommand(PlayMode mode, BaseTween tween)
 {
     if (mode == PlayMode.Append)
     {
         return(new AppendTweenCommand(tween, this));
     }
     else
     {
         return(new JoinTweenCommand(tween, this));
     }
 }
Esempio n. 6
0
        private void PlayTweenInmediatly(BaseTween tween, PlayMode playMode)
        {
            tweenList.Add(tween);

            tween.SetOnComplete(CheckIfSequenceIsComplete);
            tween.SetOnComplete(() => tween.SetIsPause(true));

            if (!ignoreCommands)
            {
                commandQueue.Add(GetCommand(playMode, tween));
            }
        }
Esempio n. 7
0
        public void Join(BaseTween tween)
        {
            tween.HandleBySequence = true;

            if (ShouldPlayInmediatly())
            {
                PlayTweenInmediatly(tween, PlayMode.Join);
                return;
            }

            var tweenP = GetPenultimate();

            PlayTweenOnComplete(tween, tweenP, PlayMode.Join);
        }
Esempio n. 8
0
        public void Append(BaseTween tween)
        {
            tween.HandleBySequence = true;

            if (ShouldPlayInmediatly())
            {
                PlayTweenInmediatly(tween, PlayMode.Append);
                head = tween;
                return;
            }

            PlayTweenOnComplete(tween, head, PlayMode.Append);
            head = tween;
        }
Esempio n. 9
0
        private void PlayTweenOnComplete(BaseTween tween, BaseTween previousTween, PlayMode playMode)
        {
            tweenList.Add(tween);

            //pause the tween until it can actually run
            tween.SetIsPause(true);
            tween.SetOnComplete(() => tween.SetIsPause(true));
            previousTween.SetOnComplete(delegate { RunTween(tween); });

            tween.SetOnComplete(CheckIfSequenceIsComplete);

            if (!ignoreCommands)
            {
                commandQueue.Add(GetCommand(playMode, tween));
            }
        }
Esempio n. 10
0
        public BaseTween FillAmountTweenAtSpeed(Image img, float to, float speed)
        {
            BaseTween tween = ValueTweenAtSpeed(img.fillAmount, to, speed);

            tween.SetOnUpdateFloat(delegate(float v)
            {
                if (img != null)
                {
                    img.fillAmount = v;
                }
                else
                {
                    CancelTween(tween);
                }
            });
            return(tween);
        }
Esempio n. 11
0
        public void ProcessConnection(BaseTween tween)
        {
            List <int> idList;

            if (tweenConnections.TryGetValue(tween.Owner, out idList))
            {
                if (idList == null)
                {
                    idList = new List <int>();
                }

                idList.Add(tween.ID);
            }

            else
            {
                tweenConnections[tween.Owner] = new List <int>()
                {
                    tween.ID
                };
            }
        }
Esempio n. 12
0
 private BaseTween ProcessTween(BaseTween tween)
 {
     tween.SetOnComplete(() => CancelTween(tween));
     return(tween);
 }
Esempio n. 13
0
 public static void FinishTween(BaseTween tween)
 {
     _activeTweens.Remove(tween);
     AddTweenToPool(tween);
 }
Esempio n. 14
0
 public static void RemoveTween(BaseTween tween)
 {
     _activeTweens.Remove(tween);
 }
Esempio n. 15
0
 private BaseTween ProcessTween(BaseTween tween)
 {
     tween.SetOnComplete(() => tween.IsComplete = true);
     tween.SetOnComplete(() => tween.Recycle(tween));
     return(tween);
 }
Esempio n. 16
0
 public JoinTweenCommand(BaseTween tween, Sequence sequence) : base(sequence)
 {
     this.tween = tween;
 }
Esempio n. 17
0
 private void RunTween(BaseTween tween)
 {
     tween.SetIsPause(false);
 }
Esempio n. 18
0
 public void RunAtTime(BaseTween tween, float time)
 {
     tween.SetIsPause(true);
     timeEvents.Add(new TimeEvent(delegate { RunTween(tween); }, time));
 }