public void Read(AssetStream stream) { Time = stream.ReadSingle(); Value.Read(stream); InSlope.Read(stream); OutSlope.Read(stream); }
public YAMLNode ExportYAML() { YAMLMappingNode node = new YAMLMappingNode(); node.AddSerializedVersion(SerializedVersion); node.Add("time", Time); node.Add("value", Value.ExportYAML()); node.Add("inSlope", InSlope.ExportYAML()); node.Add("outSlope", OutSlope.ExportYAML()); node.Add("tangentMode", 0); return(node); }
public void Read(AssetStream stream) { Time = stream.ReadSingle(); Value.Read(stream); InSlope.Read(stream); OutSlope.Read(stream); if (IsReadWeight(stream.Version)) { WeightedMode = (WeightedMode)stream.ReadInt32(); InWeight.Read(stream); OutWeight.Read(stream); } }
public YAMLNode ExportYAML(IAssetsExporter exporter) { YAMLMappingNode node = new YAMLMappingNode(); node.AddSerializedVersion(GetSerializedVersion(exporter.Version)); node.Add("time", Time); node.Add("value", Value.ExportYAML(exporter)); node.Add("inSlope", InSlope.ExportYAML(exporter)); node.Add("outSlope", OutSlope.ExportYAML(exporter)); if (GetSerializedVersion(exporter.Version) >= 2) { #warning TODO: value? node.Add("tangentMode", 0); } return(node); }
public void Read(AssetReader reader) { Time = reader.ReadSingle(); Value.Read(reader); InSlope.Read(reader); OutSlope.Read(reader); if (IsReadTangentMode(reader.Version, reader.Flags)) { TangentMode = (TangentMode)reader.ReadInt32(); } if (IsReadWeight(reader.Version)) { WeightedMode = (WeightedMode)reader.ReadInt32(); InWeight.Read(reader); OutWeight.Read(reader); } }
public void Write(AssetWriter writer) { writer.Write(Time); Value.Write(writer); InSlope.Write(writer); OutSlope.Write(writer); if (HasTangentMode(writer.Version, writer.Flags)) { writer.Write(TangentMode); } if (HasWeight(writer.Version)) { writer.Write((int)WeightedMode); InWeight.Write(writer); OutWeight.Write(writer); } }
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) { YAMLMappingNode node = new YAMLMappingNode(); node.AddSerializedVersion(GetSerializedVersion(container.Version)); node.Add("time", Time); node.Add("value", Value.ExportYAML(container)); node.Add("inSlope", InSlope.ExportYAML(container)); node.Add("outSlope", OutSlope.ExportYAML(container)); if (GetSerializedVersion(container.Version) >= 2) { node.Add("tangentMode", (int)GetTangentMode(container.Version, container.Flags)); } if (GetSerializedVersion(container.Version) >= 3) { node.Add("weightedMode", (int)WeightedMode); node.Add("inWeight", InWeight.ExportYAML(container)); node.Add("outWeight", OutWeight.ExportYAML(container)); } return(node); }
public YAMLNode ExportYAML(IExportContainer container) { YAMLMappingNode node = new YAMLMappingNode(); node.AddSerializedVersion(GetSerializedVersion(container.ExportVersion)); node.Add(TimeName, Time); node.Add(ValueName, Value.ExportYAML(container)); node.Add(InSlopeName, InSlope.ExportYAML(container)); node.Add(OutSlopeName, OutSlope.ExportYAML(container)); if (IsReadTangentMode(container.ExportVersion, container.ExportFlags)) { node.Add(TangentModeName, (int)TangentMode); } if (IsReadWeight(container.ExportVersion)) { node.Add(WeightedModeName, (int)WeightedMode); node.Add(InWeightName, InWeight.ExportYAML(container)); node.Add(OutWeightName, OutWeight.ExportYAML(container)); } return(node); }
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); }