public static void GenerateTypeTree(TypeTreeContext context, string name, TypeTreeGenerator generator) { AnimationCurveTplLayout layout = context.Layout.Serialized.AnimationCurveTpl; context.AddNode(layout.Name, name, layout.Version); context.BeginChildren(); context.AddArray(layout.CurveName, (c, n) => KeyframeTplLayout.GenerateTypeTree(c, n, generator)); if (context.Layout.IsAlign) { context.Align(); } context.AddInt32(layout.PreInfinityName); context.AddInt32(layout.PostInfinityName); if (layout.HasRotationOrder) { context.AddInt32(layout.RotationOrderName); } context.EndChildren(); }
public void Write(AssetWriter writer) { KeyframeTplLayout layout = writer.Layout.Misc.KeyframeTpl; writer.Write(Time); Value.Write(writer); InSlope.Write(writer); OutSlope.Write(writer); if (layout.HasTangentMode) { writer.Write(TangentMode); } if (layout.HasWeightedMode) { writer.Write((int)WeightedMode); InWeight.Write(writer); OutWeight.Write(writer); } }
public void Read(AssetReader reader) { KeyframeTplLayout layout = reader.Layout.Misc.KeyframeTpl; Time = reader.ReadSingle(); Value.Read(reader); InSlope.Read(reader); OutSlope.Read(reader); if (layout.HasTangentMode) { TangentMode = reader.ReadInt32(); } if (layout.HasWeightedMode) { WeightedMode = (WeightedMode)reader.ReadInt32(); InWeight.Read(reader); OutWeight.Read(reader); } }
public YAMLNode ExportYAML(IExportContainer container) { KeyframeTplLayout layout = container.ExportLayout.Misc.KeyframeTpl; YAMLMappingNode node = new YAMLMappingNode(); node.AddSerializedVersion(layout.Version); node.Add(layout.TimeName, Time); node.Add(layout.ValueName, Value.ExportYAML(container)); node.Add(layout.InSlopeName, InSlope.ExportYAML(container)); node.Add(layout.OutSlopeName, OutSlope.ExportYAML(container)); if (layout.HasTangentMode) { node.Add(layout.TangentModeName, TangentMode); } if (layout.HasWeightedMode) { node.Add(layout.WeightedModeName, (int)WeightedMode); node.Add(layout.InWeightName, InWeight.ExportYAML(container)); node.Add(layout.OutWeightName, OutWeight.ExportYAML(container)); } return(node); }
public MiscLayoutCategory(LayoutInfo info) { GUID = new GUIDLayout(info); KeyframeTpl = new KeyframeTplLayout(info); }