示例#1
0
文件: XTween.cs 项目: Rbn3D/XTween
        //Parallel Group By List
        public static XTween ParallelTweensWithList(List <XTween> list)
        {
            XTween t = new XTween(list.ToArray());

            t.groupType_ = GroupType.Parallel;
            return(t);
        }
示例#2
0
文件: XTween.cs 项目: Rbn3D/XTween
        //Serial Group
        public static XTween SerialTweens(params XTween[] args)
        {
            XTween t = new XTween(args);

            t.groupType_ = GroupType.Serial;
            return(t);
        }
示例#3
0
文件: XTween.cs 项目: Rbn3D/XTween
        //Parallel Group
        public static XTween ParallelTweens(params XTween[] args)
        {
            XTween t = new XTween(args);

            t.groupType_ = GroupType.Parallel;
            return(t);
        }
示例#4
0
文件: XTween.cs 项目: Rbn3D/XTween
 //clear current time
 private void ResetAllChildTime(XTween tween)
 {
     if (tween.children_ != null && tween.children_.Length > 0)
     {
         foreach (XTween child in tween.children_)
         {
             ResetAllChildTime(child);
         }
     }
     tween.isSetCurrentFrom_ = false;
     tween.isComplete_       = false;
     tween.currentTime_      = 0;
 }
示例#5
0
        private void PlayAnimation1(object sender, TappedRoutedEventArgs e)
        {
            Button bt = (Button)sender;
            bt.IsEnabled = false;
            double originWidth = Target1.Width;

            var tween = new XTween(Target1, "Width", originWidth, cellWidth_ - 20, 2, XTween.Easing.EaseExpoInOut);
            tween.OnCompleted += (sender_, e_) => {
                Target1.Width = originWidth;
                bt.IsEnabled = true;
            };
            tween.Play();
        }
示例#6
0
文件: XTween.cs 项目: Rbn3D/XTween
        //All Tween finish flag
        private bool IsAllChildFinish(XTween tween)
        {
            bool isAllFinish = true;

            if (tween.children_ != null && tween.children_.Length > 0)
            {
                foreach (XTween child in tween.children_)
                {
                    if (!IsAllChildFinish(child))
                    {
                        isAllFinish = false;
                        break;
                    }
                }
            }
            else
            {
                isAllFinish = tween.IsFinish();
            }
            return(isAllFinish);
        }
示例#7
0
文件: XTween.cs 项目: Rbn3D/XTween
 //Recursive processing
 private void TweenAllPlay(XTween tween, double delta)
 {
     if (tween.children_ != null && tween.children_.Length > 0)
     {
         if (tween.IsFinish())
         {
             for (int i = 0; i < tween.children_.Length; ++i)
             {
                 XTween child = tween.children_[i];
                 TweenAllPlay(child, delta);
                 if (!IsAllChildFinish(child) && tween.groupType_ == GroupType.Serial)
                 {
                     break;
                 }
             }
         }
         else
         {
             tween.AddTime(delta);
         }
     }
     else
     {
         if (!tween.IsFinish())
         {
             tween.AddTime(delta);
         }
     }
     //Check Complete
     if (!tween.isComplete_ && IsAllChildFinish(tween))
     {
         tween.isComplete_ = true;
         tween.Stop();
         EventHandler handler = tween.onCompleted_;
         if (handler != null)
         {
             handler(this, EventArgs.Empty);
         }
     }
 }
示例#8
0
文件: XTween.cs 项目: xlune/XTween
 //Recursive processing
 private void TweenAllPlay(XTween tween, double delta)
 {
     if (tween.children_ != null && tween.children_.Length > 0)
     {
         if (tween.IsFinish())
         {
             for (int i = 0; i < tween.children_.Length; ++i)
             {
                 XTween child = tween.children_[i];
                 TweenAllPlay(child, delta);
                 if (!IsAllChildFinish(child) && tween.groupType_ == GroupType.Serial)
                 {
                     break;
                 }
             }
         }
         else
         {
             tween.AddTime(delta);
         }
     }
     else
     {
         if (!tween.IsFinish())
         {
             tween.AddTime(delta);
         }
     }
     //Check Complete
     if (!tween.isComplete_ && IsAllChildFinish(tween))
     {
         tween.isComplete_ = true;
         tween.Stop();
         EventHandler handler = tween.onCompleted_;
         if (handler != null)
         {
             handler(this, EventArgs.Empty);
         }
     }
 }
示例#9
0
文件: XTween.cs 项目: xlune/XTween
 //clear current time
 private void ResetAllChildTime(XTween tween)
 {
     if (tween.children_ != null && tween.children_.Length > 0)
     {
         foreach (XTween child in tween.children_)
         {
             ResetAllChildTime(child);
         }
     }
     tween.isSetCurrentFrom_ = false;
     tween.isComplete_ = false;
     tween.currentTime_ = 0;
 }
示例#10
0
文件: XTween.cs 项目: xlune/XTween
 //All Tween finish flag
 private bool IsAllChildFinish(XTween tween)
 {
     bool isAllFinish = true;
     if (tween.children_ != null && tween.children_.Length > 0)
     {
         foreach(XTween child in tween.children_)
         {
             if (!IsAllChildFinish(child))
             {
                 isAllFinish = false;
                 break;
             }
         }
     }
     else
     {
         isAllFinish = tween.IsFinish();
     }
     return isAllFinish;
 }
示例#11
0
文件: XTween.cs 项目: xlune/XTween
 //Serial Group By List
 public static XTween SerialTweensWithList(List<XTween> list)
 {
     XTween t = new XTween(list.ToArray());
     t.groupType_ = GroupType.Serial;
     return t;
 }
示例#12
0
文件: XTween.cs 项目: xlune/XTween
 //Serial Group
 public static XTween SerialTweens(params XTween[] args)
 {
     XTween t = new XTween(args);
     t.groupType_ = GroupType.Serial;
     return t;
 }
示例#13
0
文件: XTween.cs 项目: xlune/XTween
 //Parallel Group
 public static XTween ParallelTweens(params XTween[] args)
 {
     XTween t = new XTween(args);
     t.groupType_ = GroupType.Parallel;
     return t;
 }