Esempio n. 1
0
 internal override void AddCurveData(AnimationClipCurveData curveData)
 {
     base.AddCurveData(curveData);
     if (curveData.propertyName.StartsWith("m_LocalPosition"))
     {
         if (position == null)
         {
             position = new Vector3Sampler(null, null);
         }
         position.AddCurveData(curveData);
         return;
     }
     if (curveData.propertyName.StartsWith("m_LocalRotation"))
     {
         if (rotation == null)
         {
             rotation = new QuaternionSampler(null, null);
         }
         rotation.AddCurveData(curveData);
         return;
     }
     if (curveData.propertyName.StartsWith("m_LocalScale"))
     {
         if (scale == null)
         {
             scale = new Vector3Sampler(null, null);
         }
         scale.AddCurveData(curveData);
     }
 }
Esempio n. 2
0
 internal override void AddCurveData(AnimationClipCurveData curveData)
 {
     base.AddCurveData(curveData);
     if (curveData.propertyName.StartsWith("m_LocalPosition"))
     {
         if (position == null)
         {
             position = new Vector3Sampler(null, null);
         }
         position.AddCurveData(curveData);
         return;
     }
     if (curveData.propertyName.StartsWith("m_LocalRotation"))
     {
         if (rotation == null)
         {
             rotation = new QuaternionSampler(null, null);
         }
         rotation.AddCurveData(curveData);
         return;
     }
     if (curveData.propertyName.StartsWith("m_LocalScale"))
     {
         if (scale == null)
         {
             scale = new Vector3Sampler(null, null);
         }
         scale.AddCurveData(curveData);
     }
 }
Esempio n. 3
0
 private string GetSampleKey(AnimationClipCurveData curveData)
 {
     if (curveData.type == typeof(Transform).FullName)
     {
         return(curveData.path + "/" + curveData.type);
     }
     return(curveData.path + "/" + curveData.type + ":" + ((curveData.propertyName.Contains(".")) ? curveData.propertyName.Substring(0, curveData.propertyName.LastIndexOf('.')) : curveData.propertyName));
 }
Esempio n. 4
0
        private Sampler GetSampler(GameObject g, AnimationClipCurveData curveData)
        {
            string tp = curveData.type.Replace("c:", "PressPlay.FFWD.");

            if (tp == typeof(Transform).FullName)
            {
                return(new TransformSampler(g.transform));
            }
            return(null);
        }
Esempio n. 5
0
        internal void InitializeSamplers(GameObject g)
        {
            if (clip.curves == null)
            {
                return;
            }
            Dictionary <string, Sampler> samps = new Dictionary <string, Sampler>();

            for (int i = 0; i < clip.curves.Length; i++)
            {
                AnimationClipCurveData curveData = clip.curves[i];
                string sampleKey = GetSampleKey(curveData);

                Sampler sampler = null;
                if (!samps.ContainsKey(sampleKey))
                {
                    GameObject go = g;
                    if (!String.IsNullOrEmpty(curveData.path))
                    {
                        Transform t = g.transform.Find(curveData.path);
                        if (t != null)
                        {
                            go = t.gameObject;
                        }
                        else
                        {
                            continue;
                        }
                    }

                    sampler = GetSampler(go, curveData);
                    if (sampler != null)
                    {
                        samps.Add(sampleKey, sampler);
                    }
                }
                else
                {
                    sampler = samps[sampleKey];
                }

                if (sampler != null)
                {
                    sampler.AddCurveData(curveData);
                }
            }
            samplers = new Sampler[samps.Count];
            samps.Values.CopyTo(samplers, 0);
        }
Esempio n. 6
0
 internal override void AddCurveData(AnimationClipCurveData curveData)
 {
     base.AddCurveData(curveData);
     if (curveData.propertyName.EndsWith(".x"))
     {
         x = curveData.curve;
     }
     if (curveData.propertyName.EndsWith(".y"))
     {
         y = curveData.curve;
     }
     if (curveData.propertyName.EndsWith(".z"))
     {
         z = curveData.curve;
     }
 }
Esempio n. 7
0
 internal override void AddCurveData(AnimationClipCurveData curveData)
 {
     base.AddCurveData(curveData);
     if (curveData.propertyName.EndsWith(".x"))
     {
         x = curveData.curve;
     }
     if (curveData.propertyName.EndsWith(".y"))
     {
         y = curveData.curve;
     }
     if (curveData.propertyName.EndsWith(".z"))
     {
         z = curveData.curve;
     }
 }
Esempio n. 8
0
 internal virtual void AddCurveData(AnimationClipCurveData curveData)
 {
 }
Esempio n. 9
0
 internal virtual void AddCurveData(AnimationClipCurveData curveData)
 {
 }
Esempio n. 10
0
 private Sampler GetSampler(GameObject g, AnimationClipCurveData curveData)
 {
     string tp = curveData.type.Replace("c:", "PressPlay.FFWD.");
     if (tp == typeof(Transform).FullName)
     {
         return new TransformSampler(g.transform);
     }
     return null;
 }
Esempio n. 11
0
 private string GetSampleKey(AnimationClipCurveData curveData)
 {
     if (curveData.type == typeof(Transform).FullName)
     {
         return curveData.path + "/" + curveData.type;
     }
     return curveData.path + "/" + curveData.type + ":" + ((curveData.propertyName.Contains(".")) ? curveData.propertyName.Substring(0, curveData.propertyName.LastIndexOf('.')) : curveData.propertyName);
 }