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); RuntimeAnimationClip clip = (RuntimeAnimationClip)obj; if (clip == null) { return; } ICollection <RuntimeAnimationProperty> properties = clip.Properties; if (properties != null) { int index = 0; Properties = new PersistentRuntimeAnimationProperty <TID> [properties.Count]; foreach (RuntimeAnimationProperty property in properties) { Properties[index] = new PersistentRuntimeAnimationProperty <TID>(); Properties[index].ReadFrom(property); index++; } } }