mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-15 03:30:53 +01:00
* WiP property animations system * Use better lerp for Angle property animations. * Fix handling of offset in sprite component. * Allow animating some sprite layer properties. * Allow animating some Transform properties. Obviously not advisable for server entities, but great for client side entities! * Improve animation property interpolation handling. Added a "previous" mode. Made values that cannot be sanely interpolated fall back to this mode. * Improve some animation docs.
30 lines
1.3 KiB
C#
30 lines
1.3 KiB
C#
namespace Robust.Client.Animations
|
|
{
|
|
/// <summary>
|
|
/// A single track of an <see cref="Animation"/>.
|
|
/// </summary>
|
|
public abstract class AnimationTrack
|
|
{
|
|
/// <summary>
|
|
/// Return the values necessary to initialize a playback.
|
|
/// </summary>
|
|
/// <returns>
|
|
/// A tuple containing the new key frame the animation track is on and the new time left in said key frame.
|
|
/// </returns>
|
|
public abstract (int KeyFrameIndex, float FramePlayingTime) InitPlayback();
|
|
|
|
/// <summary>
|
|
/// Advance this animation track's playback.
|
|
/// </summary>
|
|
/// <param name="context">The object this animation track is being played on, e.g. an entity.</param>
|
|
/// <param name="prevKeyFrameIndex">The key frame this animation track is on.</param>
|
|
/// <param name="prevPlayingTime">The amount of time this keyframe has been running.</param>
|
|
/// <param name="frameTime">The amount of time to increase.</param>
|
|
/// <returns>
|
|
/// A tuple containing the new key frame the animation track is on and the current time on said key frame.
|
|
/// </returns>
|
|
public abstract (int KeyFrameIndex, float FramePlayingTime)
|
|
AdvancePlayback(object context, int prevKeyFrameIndex, float prevPlayingTime, float frameTime);
|
|
}
|
|
}
|