예제 #1
0
        public void NormalizeCurveTime()
        {
            int i = 0;

            while (i < this.m_AniCurve.get_keys().Length)
            {
                Keyframe keyframe = this.m_AniCurve.get_Item(i);
                float    num      = Mathf.Max(0f, keyframe.get_time());
                float    num2     = Mathf.Min(1f, Mathf.Max(num, keyframe.get_time()));
                if (num2 != keyframe.get_time())
                {
                    Keyframe keyframe2 = new Keyframe(num2, keyframe.get_value(), keyframe.get_inTangent(), keyframe.get_outTangent());
                    this.m_AniCurve.RemoveKey(i);
                    i = 0;
                    this.m_AniCurve.AddKey(keyframe2);
                }
                else
                {
                    i++;
                }
            }
        }