Exemple #1
0
        internal static XElement SerializeMaidAnimationTrack(MovieMaidAnimationTrack track)
        {
            XElement elem = new XElement("MovieMaidAnimationTrack", SerializeCurveTrackClips(track));

            elem.SetAttributeValue("maidGuid", track.maid.Param.status.guid);
            elem.SetAttributeValue("animId", track.animation.id);

            return(elem);
        }
Exemple #2
0
        internal static MovieMaidAnimationTrack DeserializeMaidAnimationTrack(XElement elem)
        {
            try
            {
                String maidGuid    = elem.Attribute("maidGuid").Value;
                int    animationId = GetIntAttr(elem, "animId");

                Maid maid = FindMaid(maidGuid);
                if (maid == null)
                {
                    throw new ArgumentNullException($"Failed to find maid with GUID {maidGuid}!");
                }

                MovieMaidAnimationTrack track = new MovieMaidAnimationTrack(maid, animationId);
                track.clips = DeserializeCurveClips(elem);

                return(track);
            }
            catch (Exception e)
            {
                Debug.LogError(e);
                return(null);
            }
        }