示例#1
0
    public void PlayAniGroup(Dictionary <int, DismantleAni> aniConfig, Transform stepParent, bool isEndActiveTogether, bool canForward = true, bool isForward = true)
    {
        if (!canForward)
        {
            isForward = true;
        }

        group = new AnimationGroup(stepParent, isForward);
        group.isEndActiveTogether = isEndActiveTogether;
        group.endActive           = aniConfig[0].endActive;

        Ani ani;

        foreach (var item in isForward == false ? aniConfig.Reverse() : aniConfig)
        {
            ani = new Ani(item.Value.EAni, stepParent.GetChild(item.Value.ID), item.Value.endPosOri,
                          item.Value.distance, item.Value.duration);
            ani.startActive = item.Value.startActive;
            ani.endActive   = item.Value.endActive;
            ani.count       = item.Value.count;
            ani.isForward   = isForward;

            group.AddGroup(ani, item.Value.isInsertLast, item.Value.insertDuration);
        }

        if (func != null)
        {
            group.OnComplete(func);
        }

        group.Play();
    }
示例#2
0
        public void Play(Action callback)
        {
            initOnce();

            doneCallback = callback;
            animations.Play();
        }
示例#3
0
 private void FrmMain_KeyPressed(object sender, System.Windows.Forms.KeyPressEventArgs e)
 {
     switch (e.KeyChar)
     {
     case ' ':
         if (!Animator.Enabled)
         {
             AnimGrp.Play(Math.Abs(AnimGrp.Step));
             EnableAnimator();
         }
         else
         {
             AnimGrp.Pause();
             DisableAnimator();
         }
         break;
     }
 }
示例#4
0
        private void AnimButtonPlayBackward_Click(object sender, EventArgs e)
        {
            AnimGrp.Play(-Math.Abs(AnimGrp.Step));

            EnableAnimator();
        }