protected override YAMLMappingNode ExportYAMLRoot(IExportContainer container) { YAMLMappingNode node = base.ExportYAMLRoot(container); AnimationLayout layout = container.ExportLayout.Animation; node.AddSerializedVersion(layout.Version); node.Add(layout.AnimationName, DefaultAnimation.ExportYAML(container)); if (layout.HasAnimations) { node.Add(layout.AnimationsName, Animations.ExportYAML(container)); } else { node.Add(layout.AnimationsName, AnimationsPaired.ExportYAML(container)); } node.Add(layout.WrapModeName, (int)WrapMode); node.Add(layout.PlayAutomaticallyName, PlayAutomatically); node.Add(layout.AnimatePhysicsInvariantName, AnimatePhysics); if (layout.HasAnimateOnlyIfVisible) { node.Add(layout.CullingTypeName, AnimateOnlyIfVisible); } if (layout.HasCullingType) { node.Add(layout.CullingTypeName, (int)CullingType); } if (layout.HasUserAABB) { node.Add(layout.UserAABBName, UserAABB.ExportYAML(container)); } return(node); }
public override IEnumerable <PPtr <Object> > FetchDependencies(DependencyContext context) { foreach (PPtr <Object> asset in base.FetchDependencies(context)) { yield return(asset); } AnimationLayout layout = context.Layout.Animation; yield return(context.FetchDependency(DefaultAnimation, layout.AnimationName)); if (layout.HasAnimationsPaired) { foreach (PPtr <Object> asset in context.FetchDependencies(AnimationsPaired.Select(t => t.Item2), layout.AnimationsName)) { yield return(asset); } } else { foreach (PPtr <Object> asset in context.FetchDependencies(Animations, layout.AnimationsName)) { yield return(asset); } } }
public override void Write(AssetWriter writer) { base.Write(writer); AnimationLayout layout = writer.Layout.Animation; DefaultAnimation.Write(writer); if (layout.HasAnimations) { Animations.Write(writer); } else { AnimationsPaired.Write(writer); } writer.Write((int)WrapMode); writer.Write(PlayAutomatically); writer.Write(AnimatePhysics); if (layout.HasAnimateOnlyIfVisible) { writer.Write(AnimateOnlyIfVisible); } if (layout.IsAlign) { writer.AlignStream(); } if (layout.HasCullingType) { writer.Write((int)CullingType); } if (layout.HasUserAABB) { UserAABB.Write(writer); } }
public override IEnumerable <Object> FetchDependencies(ISerializedFile file, bool isLog = false) { foreach (Object asset in base.FetchDependencies(file, isLog)) { yield return(asset); } yield return(DefaultAnimation.FetchDependency(file, isLog, ToLogString, "m_DefaultAnimation")); if (IsReadAnimationsPaired(file.Version)) { foreach (PPtr <AnimationClip> clip in AnimationsPaired.Select(t => t.Item2)) { yield return(clip.FetchDependency(file, isLog, ToLogString, "m_Animations")); } } else { foreach (PPtr <AnimationClip> clip in Animations) { yield return(clip.FetchDependency(file, isLog, ToLogString, "m_Animations")); } } }
public override IEnumerable <PPtr <Object> > FetchDependencies(DependencyContext context) { foreach (PPtr <Object> asset in base.FetchDependencies(context)) { yield return(asset); } yield return(context.FetchDependency(DefaultAnimation, AnimationName)); if (IsReadAnimationsPaired(context.Version)) { foreach (PPtr <Object> asset in context.FetchDependencies(AnimationsPaired.Select(t => t.Item2), AnimationsName)) { yield return(asset); } } else { foreach (PPtr <Object> asset in context.FetchDependencies(Animations, AnimationsName)) { yield return(asset); } } }