mirror of
https://github.com/AssetRipper/AssetRipper.git
synced 2025-12-11 20:15:29 +01:00
35 lines
1.4 KiB
C#
35 lines
1.4 KiB
C#
using AssetRipper.SourceGenerated.Extensions.Enums.Keyframe;
|
|
using AssetRipper.SourceGenerated.Extensions.Enums.Keyframe.TangentMode;
|
|
using AssetRipper.SourceGenerated.Subclasses.Keyframe_Vector3f;
|
|
using AssetRipper.SourceGenerated.Subclasses.Vector3f;
|
|
|
|
namespace AssetRipper.SourceGenerated.Extensions
|
|
{
|
|
public static partial class KeyframeExtensions
|
|
{
|
|
public static void SetValues(this IKeyframe_Vector3f keyframe, UnityVersion version, float time, IVector3f value, IVector3f weight)
|
|
{
|
|
keyframe.Time = time;
|
|
keyframe.Value.CopyValues(value);
|
|
// this enum member is version agnostic
|
|
keyframe.TangentMode = TangentMode.FreeSmooth.ToTangent(version);
|
|
keyframe.WeightedMode = (int)WeightedMode.None;
|
|
keyframe.InWeight?.CopyValues(weight);
|
|
keyframe.OutWeight?.CopyValues(weight);
|
|
}
|
|
|
|
public static void SetValues(this IKeyframe_Vector3f keyframe, UnityVersion version, float time, IVector3f value, IVector3f inSlope, IVector3f outSlope, IVector3f weight)
|
|
{
|
|
keyframe.Time = time;
|
|
keyframe.Value.CopyValues(value);
|
|
keyframe.InSlope.CopyValues(inSlope);
|
|
keyframe.OutSlope.CopyValues(outSlope);
|
|
// this enum member is version agnostic
|
|
keyframe.TangentMode = TangentMode.FreeFree.ToTangent(version);
|
|
keyframe.WeightedMode = (int)WeightedMode.None;
|
|
keyframe.InWeight?.CopyValues(weight);
|
|
keyframe.OutWeight?.CopyValues(weight);
|
|
}
|
|
}
|
|
}
|