Example #1
0
        public override bool Animate(int ticks, int delay = 0)
        {
            AppearanceAnimator animator = m_Animators[m_ActiveFrameGroup];

            if (animator)
            {
                animator.Animate(ticks, delay);
                m_Phase = animator.Phase;
                return(!animator.Finished);
            }
            return(false);
        }
Example #2
0
 public override void SwitchFrameGroup(int ticks, int fgType)
 {
     fgType = Mathf.Min(fgType, m_Type.FrameGroups.Count - 1); // i.e setting walk to animate-always group!
     if (fgType != m_ActiveFrameGroup)
     {
         m_ActiveFrameGroup = fgType;
         AppearanceAnimator animator = m_Animators[m_ActiveFrameGroup];
         if (!!animator &&
             (animator.LastAnimationTick + AppearanceAnimator.AnimationDelayBeforeReset < ticks ||
              fgType != (int)Proto.Appearances001.FrameGroupType.Walking))
         {
             animator.Reset();
         }
     }
 }