Ejemplo n.º 1
0
        public AttributeAnimation(XmlElement elem)
        {
            name_          = elem.GetAttribute("name");
            speed_         = float.Parse(elem.GetAttribute("speed"));
            splineTension_ = float.Parse(elem.GetAttribute("splinetension"));
            string interp   = elem.GetAttribute("interpolation").ToLowerInvariant();
            string wrapmode = elem.GetAttribute("wrapmode").ToLowerInvariant();

            if (interp.Equals("linear"))
            {
                interp_ = InterpolationMethod.Linear;
            }
            else if (interp.Equals("linear"))
            {
                interp_ = InterpolationMethod.Spline;
            }
            if (wrapmode.Equals("clamp"))
            {
                wrap_ = AnimWrapMode.Clamp;
            }
            else if (wrapmode.Equals("loop"))
            {
                wrap_ = AnimWrapMode.Loop;
            }
            else if (wrapmode.Equals("once"))
            {
                wrap_ = AnimWrapMode.Once;
            }

            foreach (XmlElement keyelem in elem.GetElementsByTagName("keyframe"))
            {
                Keyframes.Add(new Keyframe(keyelem));
            }
        }
Ejemplo n.º 2
0
 public void PlayAnim(string animName, AnimWrapMode wrapMode)
 {
     animFlusher.Operate(opr =>
     {
         opr.SetValue(targetAnim, animName);
         opr.SetValue(animWrapMode, wrapMode);
     });
 }
        public static WrapMode ToWrapMode(this AnimWrapMode mode)
        {
            switch (mode)
            {
            case AnimWrapMode.Once:
                return(WrapMode.Once);

            case AnimWrapMode.Loop:
                return(WrapMode.Loop);

            case AnimWrapMode.OnceAndStopAtEnd:
                return(WrapMode.ClampForever);

            case AnimWrapMode.PingPong:
                return(WrapMode.PingPong);
            }

            return(WrapMode.Loop);
        }
 private static extern void Internal_setWrapMode(IntPtr thisPtr, AnimWrapMode wrapMode);
Ejemplo n.º 5
0
 public void PlayAnim(string animName, AnimWrapMode mode)
 {
     orderedName = animName;
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Initializes the state with default values.
 /// </summary>
 public void InitDefault()
 {
     speed    = 1.0f;
     weight   = 1.0f;
     wrapMode = AnimWrapMode.Loop;
 }