public override object WriteTo(object obj) { obj = base.WriteTo(obj); RuntimeAnimationClip clip = (RuntimeAnimationClip)obj; if (clip == null) { return(null); } clip.Clear(); if (Properties != null) { for (int i = 0; i < Properties.Length; ++i) { RuntimeAnimationProperty property = new RuntimeAnimationProperty(); Properties[i].WriteTo(property); clip.Add(property); } } return(clip); }
public override void ReadFrom(object obj) { base.ReadFrom(obj); RuntimeAnimationProperty property = (RuntimeAnimationProperty)obj; if (property == null) { return; } ComponentTypeName = property.ComponentTypeName; ComponentDisplayName = property.ComponentDisplayName; PropertyName = property.PropertyName; PropertyDisplayName = property.PropertyDisplayName; AnimationPropertyName = property.AnimationPropertyName; if (property.Children != null) { Children = new List <PersistentRuntimeAnimationProperty <TID> >(); for (int i = 0; i < property.Children.Count; ++i) { PersistentRuntimeAnimationProperty <TID> persistentChildProperty = new PersistentRuntimeAnimationProperty <TID>(); persistentChildProperty.ReadFrom(property.Children[i]); Children.Add(persistentChildProperty); } } if (property.Curve != null) { Curve = new PersistentAnimationCurve <TID>(); Curve.ReadFrom(property.Curve); } }
public override object WriteTo(object obj) { obj = base.WriteTo(obj); RuntimeAnimationProperty property = (RuntimeAnimationProperty)obj; if (property == null) { return(null); } property.ComponentTypeName = ComponentTypeName; property.ComponentDisplayName = ComponentDisplayName; property.PropertyName = PropertyName; property.PropertyDisplayName = PropertyDisplayName; property.AnimationPropertyName = AnimationPropertyName; if (Children != null) { property.Children = new List <RuntimeAnimationProperty>(); for (int i = 0; i < Children.Count; ++i) { RuntimeAnimationProperty childProperty = new RuntimeAnimationProperty(); Children[i].WriteTo(childProperty); childProperty.Parent = property; property.Children.Add(childProperty); } } if (Curve != null) { property.Curve = new AnimationCurve(); Curve.WriteTo(property.Curve); } return(property); }