Skip to content

GameCore.Animation ​

AnimatableVector2 双端 ​

命名空间 GameCore.Animation

csharp
public struct AnimatableVector2 : IArithmeticAnimatable<AnimatableVector2>

Represents a 2D vector that supports arithmetic operations and can be used in animation contexts.

  • value —
备注

This struct provides arithmetic operators for combining and scaling vectors, as well as implicit conversions to and from Vector2. It is designed to be used in scenarios where animatable 2D vector values are required.

构造函数 ​

AnimatableVector2 双端 ​

csharp
public AnimatableVector2(Vector2 value)

Represents a 2D vector that supports arithmetic operations and can be used in animation contexts.

  • value —
备注

This struct provides arithmetic operators for combining and scaling vectors, as well as implicit conversions to and from Vector2. It is designed to be used in scenarios where animatable 2D vector values are required.

属性 ​

PrefersRealtimeAnimation 双端 ​

csharp
public static bool PrefersRealtimeAnimation { get; }

方法 ​

operator + 双端 ​

csharp
public static AnimatableVector2 operator +(AnimatableVector2 left, AnimatableVector2 right)

operator - 双端 ​

csharp
public static AnimatableVector2 operator -(AnimatableVector2 left, AnimatableVector2 right)

operator * 双端 ​

csharp
public static AnimatableVector2 operator *(AnimatableVector2 left, double right)

operator * 双端 ​

csharp
public static AnimatableVector2 operator *(double left, AnimatableVector2 right)

operator / 双端 ​

csharp
public static AnimatableVector2 operator /(AnimatableVector2 left, double right)

implicit operator 双端 ​

csharp
public static AnimatableVector2 implicit operator(Vector2 value)

implicit operator 双端 ​

csharp
public static Vector2 implicit operator(AnimatableVector2 animatable)

字段 ​

Value 双端 ​

csharp
public Vector2 Value

AnimatableVector3 双端 ​

命名空间 GameCore.Animation

csharp
public struct AnimatableVector3 : IArithmeticAnimatable<AnimatableVector3>

Represents a 3D vector that supports arithmetic operations and can be used in animation contexts.

  • value —
备注

This struct provides arithmetic operators for combining and scaling vectors, as well as implicit conversions to and from Vector3. It is designed to be used in scenarios where animatable 3D vector values are required.

构造函数 ​

AnimatableVector3 双端 ​

csharp
public AnimatableVector3(Vector3 value)

Represents a 3D vector that supports arithmetic operations and can be used in animation contexts.

  • value —
备注

This struct provides arithmetic operators for combining and scaling vectors, as well as implicit conversions to and from Vector3. It is designed to be used in scenarios where animatable 3D vector values are required.

属性 ​

PrefersRealtimeAnimation 双端 ​

csharp
public static bool PrefersRealtimeAnimation { get; }

方法 ​

operator + 双端 ​

csharp
public static AnimatableVector3 operator +(AnimatableVector3 left, AnimatableVector3 right)

operator - 双端 ​

csharp
public static AnimatableVector3 operator -(AnimatableVector3 left, AnimatableVector3 right)

operator * 双端 ​

csharp
public static AnimatableVector3 operator *(AnimatableVector3 left, double right)

operator * 双端 ​

csharp
public static AnimatableVector3 operator *(double left, AnimatableVector3 right)

operator / 双端 ​

csharp
public static AnimatableVector3 operator /(AnimatableVector3 left, double right)

implicit operator 双端 ​

csharp
public static AnimatableVector3 implicit operator(Vector3 value)

implicit operator 双端 ​

csharp
public static Vector3 implicit operator(AnimatableVector3 animatable)

字段 ​

Value 双端 ​

csharp
public Vector3 Value

AnimatedImageSource 双端 ​

命名空间 GameCore.Animation

csharp
public class AnimatedImageSource : DisposableObject, IGameObject<GameDataAnimatedImage>, IGameObject, IAnimatedImageSource

构造函数 ​

AnimatedImageSource 双端 ​

csharp
public AnimatedImageSource(IGameLink<GameDataAnimatedImage> link)

属性 ​

csharp
public IGameLink<GameDataAnimatedImage> Link { get; }

Cache 双端 ​

csharp
public GameDataAnimatedImage Cache { get; }

FallbackFrameState 双端 ​

csharp
public AnimationState.FrameState? FallbackFrameState { get; set; }

Scale 双端 ​

csharp
public Vector2 Scale { get; set; }

Speed 双端 ​

csharp
public float Speed { get; set; }

FlipHorizontal 双端 ​

csharp
public bool FlipHorizontal { get; set; }

是否水平翻转(左右镜像)

FlipVertical 双端 ​

csharp
public bool FlipVertical { get; set; }

是否垂直翻转(上下镜像)

DebugConfig 双端 ​

csharp
public AnimatedImageDebugConfig DebugConfig { get; set; }

调试配置,用于在开发时可视化动画的各种属性。 初始化时从 DebugConfig 复制, 可在运行时修改以覆盖数据配置。

DebugDraw 双端 ​

csharp
public bool DebugDraw { get; set; }

调试模式开关的便捷属性,等同于 DebugConfig.Enabled

AnimationStates 双端 ​

csharp
public Dictionary<string, AnimationState> AnimationStates { get; }

CurrentAnimationState 双端 ​

csharp
public AnimationState? CurrentAnimationState { get; }

LayerDefines 双端 ​

csharp
public Dictionary<string, LayerDefine> LayerDefines { get; }

StartTimeInMilliseconds 双端 ​

csharp
public int StartTimeInMilliseconds { get; }

IsAnimationFinished 双端 ​

csharp
public bool IsAnimationFinished { get; }

动画是否已结束(仅在有限循环次数时有效)

IsPaused 双端 ​

csharp
public bool IsPaused { get; }

动画是否已暂停

CurrentAnimationName 双端 ​

csharp
public string? CurrentAnimationName { get; }

获取当前播放的动画名称

EffectiveSpeed 双端 ​

csharp
public float EffectiveSpeed { get; }

获取当前生效的播放速度(全局速度 × 当前动画速度倍率)

方法 ​

PlayAnimation 双端 ​

csharp
public AnimationState.FrameState? PlayAnimation(string animationName, int canvasElapsedMilliseconds, int startTimeInMilliseconds = 0, AnimationStartTimeSetType startTimeSetType = AnimationStartTimeSetType.FromCurrentTime)

播放指定名称的动画

  • animationName — 动画名称
  • canvasElapsedMilliseconds — 当前画布时间(毫秒)
  • startTimeInMilliseconds — 起始时间偏移(毫秒)
  • startTimeSetType — 起始时间设置类型

返回: 当前帧状态,如果找不到动画返回 null

PlayAnimationWithDuration 双端 ​

csharp
public AnimationState.FrameState? PlayAnimationWithDuration(string animationName, int canvasElapsedMilliseconds, int targetDurationMilliseconds)

播放指定名称的动画,并将动画时长缩放到指定时长

  • animationName — 动画名称
  • canvasElapsedMilliseconds — 当前画布时间(毫秒)
  • targetDurationMilliseconds — 目标播放时长(毫秒)

返回: 当前帧状态,如果找不到动画返回 null

备注

此方法会自动计算播放速度倍率,使动画恰好在指定时长内播放完成一次循环。 适用于需要根据游戏属性(如攻速)调整特定动画时长,而不影响其他动画速度的场景。 速度倍率仅影响当前动画,调用普通 AnimationStartTimeSetType) 时会重置为 1.0。

Pause 双端 ​

csharp
public void Pause(int canvasElapsedMilliseconds)

暂停动画

  • canvasElapsedMilliseconds — 当前画布时间(毫秒)

Resume 双端 ​

csharp
public void Resume(int canvasElapsedMilliseconds)

恢复动画播放

  • canvasElapsedMilliseconds — 当前画布时间(毫秒)

TogglePause 双端 ​

csharp
public void TogglePause(int canvasElapsedMilliseconds)

切换暂停/播放状态

  • canvasElapsedMilliseconds — 当前画布时间(毫秒)

GetExpectedFrameState 双端 ​

csharp
public AnimationState.FrameState? GetExpectedFrameState(int canvasElapsedMilliseconds)

获取指定时间点的预期帧状态

  • canvasElapsedMilliseconds — 画布经过的时间(毫秒)

返回: 当前帧状态,如果没有动画或动画已结束(且设置为隐藏)返回 null

GetProgress 双端 ​

csharp
public AnimationProgress? GetProgress(int canvasElapsedMilliseconds)

获取指定时间点的动画播放进度信息

  • canvasElapsedMilliseconds — 画布经过的时间(毫秒)

返回: 播放进度信息,如果没有动画则返回 null

GetLayerBounds 双端 ​

csharp
public LayerBounds? GetLayerBounds(string layerName, int canvasElapsedMilliseconds)

获取指定图层在当前帧中的边界信息(相对于锚点的本地坐标)

  • layerName — 图层名称
  • canvasElapsedMilliseconds — 画布经过的时间(毫秒)

返回: 图层边界信息,如果当前帧不包含该图层则返回 null

备注

返回的边界是相对于动画锚点的本地坐标,已考虑翻转和缩放。 适用于根据动画帧动态创建碰撞盒或攻击判定区域。

GetLayerWorldBounds 双端 ​

csharp
public LayerBounds? GetLayerWorldBounds(string layerName, int canvasElapsedMilliseconds, float x, float y)

获取指定图层在当前帧中的世界坐标边界

  • layerName — 图层名称
  • canvasElapsedMilliseconds — 画布经过的时间(毫秒)
  • x — 绘制位置的X坐标(锚点位置)
  • y — 绘制位置的Y坐标(锚点位置)

返回: 图层在世界坐标中的边界,如果当前帧不包含该图层则返回 null

Draw 双端 ​

csharp
public void Draw(ICanvasImage canvasImage, int canvasElapsedMilliseconds, float x, float y)

绘制当前帧到画布

  • canvasImage — 画布接口
  • canvasElapsedMilliseconds — 画布经过的时间(毫秒)
  • x — 绘制位置的X坐标
  • y — 绘制位置的Y坐标

DrawFrame 双端 ​

csharp
public bool DrawFrame(ICanvasImage canvasImage, int frameIndex, float x, float y, bool useAbsoluteIndex = false)

绘制指定索引的帧到画布

  • canvasImage — 画布接口
  • frameIndex — 帧索引
  • x — 绘制位置的X坐标
  • y — 绘制位置的Y坐标
  • useAbsoluteIndex — 如果为 true,则 frameIndex 是图集中的绝对帧索引; 如果为 false(默认),则 frameIndex 是当前动画内的相对帧索引

返回: 是否成功绘制(索引有效时返回 true)

AnimationProgress 双端 ​

命名空间 GameCore.Animation

csharp
public readonly struct AnimationProgress

动画播放进度信息

属性 ​

NormalizedTime 双端 ​

csharp
public float NormalizedTime { get; init; }

归一化播放进度(0.0 ~ 1.0)

备注

表示当前循环内的播放进度。0.0 表示循环开始,1.0 表示循环结束。

CurrentFrameIndex 双端 ​

csharp
public int CurrentFrameIndex { get; init; }

当前帧索引(相对于当前动画片段)

TotalFrameCount 双端 ​

csharp
public int TotalFrameCount { get; init; }

动画片段的总帧数

CurrentLoop 双端 ​

csharp
public int CurrentLoop { get; init; }

当前循环次数(从0开始)

TimeInLoopMilliseconds 双端 ​

csharp
public int TimeInLoopMilliseconds { get; init; }

当前循环内已播放的时间(毫秒)

TotalDurationMilliseconds 双端 ​

csharp
public int TotalDurationMilliseconds { get; init; }

单次循环的总时长(毫秒)

ArithmeticAggregator 双端 ​

命名空间 GameCore.Animation

csharp
public class ArithmeticAggregator<TArithmetic> where TArithmetic : struct, IArithmeticAnimatable<TArithmetic>, IEquatable<TArithmetic>

Aggregates multiple ArithmeticMixer1instances, each identified by a unique key, and computes a final combined value. Notifies subscribers via theOnValueChanged` event when the aggregated value changes.

构造函数 ​

ArithmeticAggregator 双端 ​

csharp
public ArithmeticAggregator()

ArithmeticAggregator 双端 ​

csharp
public ArithmeticAggregator(Action<TArithmetic?> onValueChanged)

Initializes a new instance of the ArithmeticAggregator1` class and subscribes to value change notifications.

  • onValueChanged — An action to invoke when the aggregated value changes.

方法 ​

SetMixer 双端 ​

csharp
public void SetMixer(object key, ArithmeticMixer<TArithmetic> mixer)

Sets or updates a ArithmeticMixer1` for the specified key and updates the aggregated value.

  • key — The unique key identifying the mixer.
  • mixer — The ArithmeticMixer1` to associate with the key.

AnimateMixer 双端 ​

csharp
public ArithmeticAnimation<ArithmeticMixer<TArithmetic>> AnimateMixer(object key, ArithmeticAnimation<ArithmeticMixer<TArithmetic>> animation)

Starts an animation for the specified key using the provided ArithmeticAnimation1`. The animation will update the associated mixer value over time.

  • key — The unique key identifying the mixer to animate.
  • animation — The animation to apply to the mixer.

返回: The started animation.

AnimateMixer 双端 ​

csharp
public ArithmeticAnimation<ArithmeticMixer<TArithmetic>> AnimateMixer(object key, ArithmeticMixer<TArithmetic> blendTo, TimeSpan blendTime, bool autoReverse = false, RepeatBehavior? repeatBehavior = null)

Starts an animation that blends the mixer associated with the specified key to a target value over a given duration.

  • key — The unique key identifying the mixer to animate.
  • blendTo — The target mixer value to blend to.
  • blendTime — The duration of the blend animation.
  • autoReverse — Whether the animation should automatically reverse when finished.
  • repeatBehavior — Specifies how the animation repeats. If null, a default repeat behavior is used.

返回: The started animation.

AnimateMixer 双端 ​

csharp
public ArithmeticAnimation<ArithmeticMixer<TArithmetic>> AnimateMixer(object key, ArithmeticMixer<TArithmetic> blendFrom, ArithmeticMixer<TArithmetic> blendTo, TimeSpan blendTime, bool autoReverse = false, RepeatBehavior? repeatBehavior = null)

Starts an animation that blends the mixer associated with the specified key from a starting value to a target value over a given duration.

  • key — The unique key identifying the mixer to animate.
  • blendFrom — The starting mixer value for the animation.
  • blendTo — The target mixer value to blend to.
  • blendTime — The duration of the blend animation.
  • autoReverse — Whether the animation should automatically reverse when finished.
  • repeatBehavior — Specifies how the animation repeats. If null, a default repeat behavior is used.

返回: The started animation.

ClearAnimation 双端 ​

csharp
public void ClearAnimation(object key, CancelBehavior cancelBehavior = CancelBehavior.Hold)

Cancels and removes any running animation associated with the specified key.

  • key — The unique key identifying the animation to clear.
  • cancelBehavior — Specifies how the animation should be canceled. Defaults to Hold.

GetMixer 双端 ​

csharp
public ArithmeticMixer<TArithmetic>? GetMixer(object key)

Retrieves the ArithmeticMixer1` associated with the specified key.

  • key — The key used to locate the mixer. Must not be null.

返回: The ArithmeticMixer1associated with the specified key, ornull` if no mixer is found.

RemoveMixer 双端 ​

csharp
public void RemoveMixer(object key)

Removes the ArithmeticMixer1` associated with the specified key and updates the aggregated value.

  • key — The unique key identifying the mixer to remove.

ClearAll 双端 ​

csharp
public void ClearAll()

Clears all active animations and resets the internal state.

备注

This method cancels all currently running animations and removes them from the internal collection. After calling this method, the system will have no active animations or mixers.

GetFinalValue 双端 ​

csharp
public TArithmetic? GetFinalValue()

Gets the final aggregated value by combining all mixers. Returns null if there are no mixers.

返回: The aggregated value, or null if none exist.

事件 ​

OnValueChanged 双端 ​

csharp
public event Action<TArithmetic?>? OnValueChanged

Occurs when the aggregated value changes.

ArithmeticAnimation 双端 ​

命名空间 GameCore.Animation

csharp
public class ArithmeticAnimation<T> : TimelineAnimation where T : struct, IArithmeticAnimatable<T>

构造函数 ​

ArithmeticAnimation 双端 ​

csharp
public ArithmeticAnimation()

属性 ​

EasingFunction 双端 ​

csharp
public IEasingFunction? EasingFunction { get; set; }

property for easing function, if null use linear interpolation. Will automatically be cleared when the animation is stopped.

From 双端 ​

csharp
public T? From { get; set; }

To 双端 ​

csharp
public T? To { get; set; }

By 双端 ​

csharp
public T? By { get; set; }

OnUpdate 双端 ​

csharp
public Action<T>? OnUpdate { get; set; }

Gets or sets the action to be invoked when an update occurs. Will automatically be cleared when the animation is stopped.

FromValueGetter 双端 ​

csharp
public Func<T>? FromValueGetter { get; set; }

Only used if From is null. If set, this will be used to get the starting value of the animation. Will automatically be cleared when the animation is stopped.

方法 ​

Start 双端 ​

csharp
public override void Start()

Cancel 双端 ​

csharp
public override void Cancel(CancelBehavior cancelBehavior = CancelBehavior.Hold)

Update 双端 ​

csharp
protected override void Update(int deltaTime)

StopSynchronous 双端 ​

csharp
protected override bool StopSynchronous(bool completed)

ArithmeticMixer 双端 ​

命名空间 GameCore.Animation

csharp
public struct ArithmeticMixer<TArithmetic> : IArithmeticAnimatable<ArithmeticMixer<TArithmetic>> where TArithmetic : struct, IArithmeticAnimatable<TArithmetic>

Represents a weighted value of a generic type for mixing and aggregation. Provides methods and operators to combine multiple values with associated weights, enabling smooth blending and accumulation of any animatable value.

  • value — The animatable value.
  • weight — The weight associated with the value. Defaults to 1.0.
备注

Initializes a new instance of the ArithmeticMixer1` struct with the specified value and weight.

构造函数 ​

ArithmeticMixer 双端 ​

csharp
public ArithmeticMixer(TArithmetic value, double weight = 1.0)

Represents a weighted value of a generic type for mixing and aggregation. Provides methods and operators to combine multiple values with associated weights, enabling smooth blending and accumulation of any animatable value.

  • value — The animatable value.
  • weight — The weight associated with the value. Defaults to 1.0.
备注

Initializes a new instance of the ArithmeticMixer1` struct with the specified value and weight.

属性 ​

PrefersRealtimeAnimation 双端 ​

csharp
public static bool PrefersRealtimeAnimation { get; }

方法 ​

implicit operator 双端 ​

csharp
public static ArithmeticMixer<TArithmetic> implicit operator(TArithmetic value)

Implicitly converts a to an ArithmeticMixer1` with default weight.

  • value — The value to convert.

Mix 双端 ​

csharp
public ArithmeticMixer<TArithmetic> Mix(ArithmeticMixer<TArithmetic> other)

Mixes this value with another ArithmeticMixer1`, producing a new weighted average value.

  • other — The other mixer to combine with.

返回: A new ArithmeticMixer1` representing the mixed value and combined weight.

implicit operator 双端 ​

csharp
public static TArithmetic implicit operator(ArithmeticMixer<TArithmetic> mixer)

Implicitly converts an ArithmeticMixer1` to a by returning its value.

  • mixer — The mixer to convert.

字段 ​

Value 双端 ​

csharp
public TArithmetic Value

The value being mixed or aggregated.

Weight 双端 ​

csharp
public double Weight

Gets or sets the weight of the value. 0 means no contribution.

ArithmeticNumber 双端 ​

命名空间 GameCore.Animation

csharp
public struct ArithmeticNumber<T> : IArithmeticAnimatable<ArithmeticNumber<T>> where T : struct, INumber<T>

Wraps numeric types with arithmetic operations to make them usable in ArithmeticMixer1, ArithmeticAnimation1 and ArithmeticTuple2. For non-complex animations, consider using NumberAnimation1 instead.

构造函数 ​

ArithmeticNumber 双端 ​

csharp
public ArithmeticNumber(T value)

Wraps numeric types with arithmetic operations to make them usable in ArithmeticMixer1, ArithmeticAnimation1 and ArithmeticTuple2. For non-complex animations, consider using NumberAnimation1 instead.

属性 ​

PrefersRealtimeAnimation 双端 ​

csharp
public static bool PrefersRealtimeAnimation { get; }

方法 ​

operator + 双端 ​

csharp
public static ArithmeticNumber<T> operator +(ArithmeticNumber<T> left, ArithmeticNumber<T> right)

operator - 双端 ​

csharp
public static ArithmeticNumber<T> operator -(ArithmeticNumber<T> left, ArithmeticNumber<T> right)

operator * 双端 ​

csharp
public static ArithmeticNumber<T> operator *(ArithmeticNumber<T> left, double right)

operator * 双端 ​

csharp
public static ArithmeticNumber<T> operator *(double left, ArithmeticNumber<T> right)

operator / 双端 ​

csharp
public static ArithmeticNumber<T> operator /(ArithmeticNumber<T> left, double right)

implicit operator 双端 ​

csharp
public static ArithmeticNumber<T> implicit operator(T value)

implicit operator 双端 ​

csharp
public static T implicit operator(ArithmeticNumber<T> animatable)

字段 ​

Value 双端 ​

csharp
public T Value

ArithmeticTuple 双端 ​

命名空间 GameCore.Animation

csharp
public struct ArithmeticTuple<T1, T2, T3, T4, T5, T6, T7, T8> : IArithmeticAnimatable<ArithmeticTuple<T1, T2, T3, T4, T5, T6, T7, T8>>, IEquatable<ArithmeticTuple<T1, T2, T3, T4, T5, T6, T7, T8>> where T1 : struct, IArithmeticAnimatable<T1> where T2 : struct, IArithmeticAnimatable<T2> where T3 : struct, IArithmeticAnimatable<T3> where T4 : struct, IArithmeticAnimatable<T4> where T5 : struct, IArithmeticAnimatable<T5> where T6 : struct, IArithmeticAnimatable<T6> where T7 : struct, IArithmeticAnimatable<T7> where T8 : struct, IArithmeticAnimatable<T8>

Represents a tuple of eight arithmetic animatable values that can be used in animation contexts. This is a generic implementation for tuples with more than 4 elements.

构造函数 ​

ArithmeticTuple 双端 ​

csharp
public ArithmeticTuple(T1 Item1, T2 Item2, T3 Item3, T4 Item4, T5 Item5, T6 Item6, T7 Item7, T8 Item8)

Represents a tuple of eight arithmetic animatable values that can be used in animation contexts. This is a generic implementation for tuples with more than 4 elements.

属性 ​

Item1 双端 ​

csharp
public T1 Item1 { get; set; }

Item2 双端 ​

csharp
public T2 Item2 { get; set; }

Item3 双端 ​

csharp
public T3 Item3 { get; set; }

Item4 双端 ​

csharp
public T4 Item4 { get; set; }

Item5 双端 ​

csharp
public T5 Item5 { get; set; }

Item6 双端 ​

csharp
public T6 Item6 { get; set; }

Item7 双端 ​

csharp
public T7 Item7 { get; set; }

Item8 双端 ​

csharp
public T8 Item8 { get; set; }

PrefersRealtimeAnimation 双端 ​

csharp
public static bool PrefersRealtimeAnimation { get; }

方法 ​

operator + 双端 ​

csharp
public static ArithmeticTuple<T1, T2, T3, T4, T5, T6, T7, T8> operator +(ArithmeticTuple<T1, T2, T3, T4, T5, T6, T7, T8> left, ArithmeticTuple<T1, T2, T3, T4, T5, T6, T7, T8> right)

operator - 双端 ​

csharp
public static ArithmeticTuple<T1, T2, T3, T4, T5, T6, T7, T8> operator -(ArithmeticTuple<T1, T2, T3, T4, T5, T6, T7, T8> left, ArithmeticTuple<T1, T2, T3, T4, T5, T6, T7, T8> right)

operator * 双端 ​

csharp
public static ArithmeticTuple<T1, T2, T3, T4, T5, T6, T7, T8> operator *(ArithmeticTuple<T1, T2, T3, T4, T5, T6, T7, T8> left, double right)

operator * 双端 ​

csharp
public static ArithmeticTuple<T1, T2, T3, T4, T5, T6, T7, T8> operator *(double left, ArithmeticTuple<T1, T2, T3, T4, T5, T6, T7, T8> right)

operator / 双端 ​

csharp
public static ArithmeticTuple<T1, T2, T3, T4, T5, T6, T7, T8> operator /(ArithmeticTuple<T1, T2, T3, T4, T5, T6, T7, T8> left, double right)

ToString 双端 ​

csharp
public override readonly string ToString()

operator != 双端 ​

csharp
public static bool operator !=(ArithmeticTuple<T1, T2, T3, T4, T5, T6, T7, T8> left, ArithmeticTuple<T1, T2, T3, T4, T5, T6, T7, T8> right)

operator == 双端 ​

csharp
public static bool operator ==(ArithmeticTuple<T1, T2, T3, T4, T5, T6, T7, T8> left, ArithmeticTuple<T1, T2, T3, T4, T5, T6, T7, T8> right)

GetHashCode 双端 ​

csharp
public override readonly int GetHashCode()

Equals 双端 ​

csharp
public override readonly bool Equals(object obj)

Equals 双端 ​

csharp
public readonly bool Equals(ArithmeticTuple<T1, T2, T3, T4, T5, T6, T7, T8> other)

Deconstruct 双端 ​

csharp
public readonly void Deconstruct(out T1 Item1, out T2 Item2, out T3 Item3, out T4 Item4, out T5 Item5, out T6 Item6, out T7 Item7, out T8 Item8)

IAnimatedImageSource 双端 ​

命名空间 GameCore.Animation

csharp
public interface IAnimatedImageSource

属性 ​

IsAnimationFinished 双端 ​

csharp
public bool IsAnimationFinished { get; }

动画是否已结束(仅在有限循环次数时有效)

IsPaused 双端 ​

csharp
public bool IsPaused { get; }

动画是否已暂停

FlipHorizontal 双端 ​

csharp
public bool FlipHorizontal { get; set; }

是否水平翻转(左右镜像)

备注

用于实现角色朝向切换,当素材只有单一朝向时,通过水平翻转实现另一个方向。

FlipVertical 双端 ​

csharp
public bool FlipVertical { get; set; }

是否垂直翻转(上下镜像)

CurrentAnimationName 双端 ​

csharp
public string? CurrentAnimationName { get; }

获取当前播放的动画名称

方法 ​

GetProgress 双端 ​

csharp
AnimationProgress? GetProgress(int canvasElapsedMilliseconds)

获取指定时间点的动画播放进度信息

  • canvasElapsedMilliseconds — 画布经过的时间(毫秒)

返回: 播放进度信息,如果没有动画则返回 null

PlayAnimation 双端 ​

csharp
void PlayAnimation(string animationName, int canvasElapsedMilliseconds, int startTimeInMilliseconds = 0, AnimationStartTimeSetType startTimeSetType = AnimationStartTimeSetType.FromCurrentTime)

播放指定名称的动画

Pause 双端 ​

csharp
void Pause(int canvasElapsedMilliseconds)

暂停动画

Resume 双端 ​

csharp
void Resume(int canvasElapsedMilliseconds)

恢复动画播放

TogglePause 双端 ​

csharp
void TogglePause(int canvasElapsedMilliseconds)

切换暂停/播放状态

Draw 双端 ​

csharp
void Draw(ICanvasImage canvasImage, int canvasElapsedMilliseconds, float x, float y)

绘制当前帧到画布

IArithmeticAnimatable 双端 ​

命名空间 GameCore.Animation

csharp
public interface IArithmeticAnimatable<TSelf> where TSelf : struct, IArithmeticAnimatable<TSelf>

属性 ​

PrefersRealtimeAnimation 双端 ​

csharp
static abstract bool PrefersRealtimeAnimation { get; }

方法 ​

operator + 双端 ​

csharp
static abstract TSelf operator +(TSelf left, TSelf right)

Add 双端 ​

csharp
static TSelf Add(TSelf left, TSelf right)

operator - 双端 ​

csharp
static abstract TSelf operator -(TSelf left, TSelf right)

Subtract 双端 ​

csharp
static TSelf Subtract(TSelf left, TSelf right)

operator * 双端 ​

csharp
static abstract TSelf operator *(TSelf left, double right)

Multiply 双端 ​

csharp
static TSelf Multiply(TSelf left, double right)

operator / 双端 ​

csharp
static abstract TSelf operator /(TSelf left, double right)

Divide 双端 ​

csharp
static TSelf Divide(TSelf left, double right)

operator * 双端 ​

csharp
static abstract TSelf operator *(double left, TSelf right)

Multiply 双端 ​

csharp
static TSelf Multiply(double left, TSelf right)

ICanvasImage 双端 ​

命名空间 GameCore.Animation

csharp
public interface ICanvasImage

属性 ​

Alpha 双端 ​

csharp
public float Alpha { get; set; }

获取或设置全局透明度,范围为0.0到1.0

方法 ​

SaveState 双端 ​

csharp
void SaveState()

保存当前画布状态(包括透明度、变换等)

RestoreState 双端 ​

csharp
void RestoreState()

恢复之前保存的画布状态

DrawImage 双端 ​

csharp
void DrawImage(Image image, float sourceX, float sourceY, float sourceWidth, float sourceHeight, float x, float y, float width, float height)

绘制图像的指定区域到画布的指定位置和尺寸

DrawRect 双端 ​

csharp
void DrawRect(float x, float y, float width, float height, Color color)

绘制矩形边框(用于调试)

  • x — 左上角X坐标
  • y — 左上角Y坐标
  • width — 宽度
  • height — 高度
  • color — 边框颜色

DrawLine 双端 ​

csharp
void DrawLine(float x1, float y1, float x2, float y2, Color color)

绘制线条(用于调试)

  • x1 — 起点X坐标
  • y1 — 起点Y坐标
  • x2 — 终点X坐标
  • y2 — 终点Y坐标
  • color — 线条颜色

FillCircle 双端 ​

csharp
void FillCircle(float centerX, float centerY, float radius, Color color)

填充圆形(用于调试)

  • centerX — 圆心X坐标
  • centerY — 圆心Y坐标
  • radius — 半径
  • color — 填充颜色

NumberAnimation 双端 ​

命名空间 GameCore.Animation

csharp
public class NumberAnimation<T> : TimelineAnimation where T : struct, INumber<T>

An animation class that animates a number from one value to another over a specified duration. Requires to be manually started.

构造函数 ​

NumberAnimation 双端 ​

csharp
public NumberAnimation()

属性 ​

EasingFunction 双端 ​

csharp
public IEasingFunction? EasingFunction { get; set; }

property for easing function, if null use linear interpolation

From 双端 ​

csharp
public T? From { get; set; }

To 双端 ​

csharp
public T? To { get; set; }

By 双端 ​

csharp
public T? By { get; set; }

OnUpdate 双端 ​

csharp
public Action<T>? OnUpdate { get; set; }

FromValueGetter 双端 ​

csharp
public Func<T>? FromValueGetter { get; set; }

Only used if From is null. If set, this will be used to get the starting value of the animation.

方法 ​

Start 双端 ​

csharp
public override void Start()

Cancel 双端 ​

csharp
public override void Cancel(CancelBehavior cancelBehavior = CancelBehavior.Hold)

Update 双端 ​

csharp
protected override void Update(int deltaTime)

TimelineAnimation 双端 ​

命名空间 GameCore.Animation

csharp
public abstract class TimelineAnimation : Awaitable<int>

Represents an abstract base class for timeline-based animations that can be played, reversed, and repeated over time.

  • adjustment — Optional time adjustment in milliseconds to apply to the animation start time.
备注

TimelineAnimation provides a framework for creating time-based animations that integrate with the game's tick system and async/await patterns. It supports various playback modes including auto-reverse, repeat counts, and duration-based repetition. Derived classes implement the specific animation logic by overriding the Update method.

构造函数 ​

TimelineAnimation 双端 ​

csharp
protected TimelineAnimation(int adjustment = 0)

Represents an abstract base class for timeline-based animations that can be played, reversed, and repeated over time.

  • adjustment — Optional time adjustment in milliseconds to apply to the animation start time.
备注

TimelineAnimation provides a framework for creating time-based animations that integrate with the game's tick system and async/await patterns. It supports various playback modes including auto-reverse, repeat counts, and duration-based repetition. Derived classes implement the specific animation logic by overriding the Update method.

属性 ​

IsInReverse 双端 ​

csharp
public bool IsInReverse { get; set; }

Gets a value indicating whether the animation is currently playing in reverse.

备注

This property is automatically managed when AutoReverse is enabled. When the animation reaches the end of its duration, it will reverse direction if AutoReverse is true.

CurrentCount 双端 ​

csharp
public int CurrentCount { get; set; }

Gets the current repeat count of the animation.

备注

This value increments each time the animation completes a full cycle. For auto-reversing animations, a complete cycle includes both forward and reverse playback.

AutoReverse 双端 ​

csharp
public bool AutoReverse { get; init; }

Gets or sets a value indicating whether the animation should automatically reverse direction when it reaches the end.

备注

When enabled, the animation will play forward to the end, then backward to the beginning, creating a ping-pong effect. This counts as one complete cycle for repeat behavior purposes.

Duration 双端 ​

csharp
public TimeSpan Duration { get; init; }

Gets or sets the duration of one animation cycle.

备注

This defines how long it takes for the animation to complete one forward playback. For auto-reversing animations, the total cycle time is twice this duration.

RepeatBehavior 双端 ​

csharp
public RepeatBehavior RepeatBehavior { get; init; }

Gets or sets the repeat behavior that controls how the animation repeats.

备注

This can be set to a specific count, a duration, or forever. The default is 1, meaning the animation plays once and then stops.

AdjustByFrameDelta 双端 ​

csharp
public bool AdjustByFrameDelta { get; set; }

Gets or sets a value indicating whether adjustments should be applied relative to the frame delta time. Basically, if you want to use the game tick or real time. Animation that may affect the game state should use false, while animations that are purely visual can use true.

备注

Animations that may affect the game state should use false for consistent timing, while animations that are purely visual can use true for smoother real-time playback.

方法 ​

Pause 双端 ​

csharp
public void Pause(bool on)

Pauses or resumes the animation playback.

  • on — True to pause the animation; false to resume it.
备注

When paused, the animation will stop advancing and remain at its current position. This method has no effect if the animation has already completed.

GetResult 双端 ​

csharp
public override int GetResult()

Gets the result value of the animation when it completes.

返回: The final time value of the animation, depending on the repeat behavior.

备注

For duration-based repeat behavior, returns the remaining total time. For other behaviors, returns the current time position, accounting for reverse playback.

ThinkAction 双端 ​

csharp
protected override void ThinkAction(int delta)

Advances the animation by the specified time delta.

  • delta — The time delta since the last update in milliseconds.
备注

This method is called automatically by the thinking system. It updates the animation's time position, handles direction changes for auto-reverse, and calls the Update method for derived classes to implement their specific animation logic.

Update 双端 ​

csharp
protected abstract void Update(int deltaTime)

Updates the animation state based on the current time position.

  • deltaTime — The current time position in the animation in milliseconds.
备注

This abstract method must be implemented by derived classes to define the specific animation behavior. It is called every frame while the animation is active.

Cancel 双端 ​

csharp
public abstract void Cancel(CancelBehavior cancelBehavior = CancelBehavior.Hold)

Cancels the animation with the specified cancellation behavior.

  • cancelBehavior — The behavior to apply when cancelling the animation.
备注

This abstract method must be implemented by derived classes to define how the animation should handle cancellation, such as jumping to the end state or holding the current state.

ThinkFinish 双端 ​

csharp
protected override bool ThinkFinish()

Determines whether the animation should finish based on its repeat behavior and current state.

返回: True if the animation should complete; otherwise, false.

备注

This method handles the complex logic for determining animation completion based on repeat behavior, auto-reverse settings, and current cycle counts.

Start 双端 ​

csharp
public override void Start()

Starts the animation and initializes its state.

备注

This method sets up the initial animation state including time position, duration, and repeat behavior configuration. It then calls the base Start method to begin execution.

字段 ​

durationInMilliseconds 双端 ​

csharp
protected double durationInMilliseconds

GameDataAnimatedImage 双端 ​

命名空间 GameCore.Animation.Data

csharp
public class GameDataAnimatedImage : GameDataCategory<GameDataAnimatedImage>, IGameDataCategory<GameDataAnimatedImage>, IGameData<GameDataAnimatedImage>, IGameData

序列帧动画配置,定义图集、帧、图层与动画标签。

构造函数 ​

GameDataAnimatedImage 双端 ​

csharp
public GameDataAnimatedImage(GameLink<GameDataAnimatedImage, GameDataAnimatedImage> link)

GameDataAnimatedImage 双端 ​

csharp
public GameDataAnimatedImage(IGameLink<GameDataAnimatedImage> link)

属性 ​

Image 双端 ​

csharp
public Image Image { get; set; }

原始图集图片资源

CanvasSize 双端 ​

csharp
public Size CanvasSize { get; set; }

渲染对象的尺寸(像素)

Frames 双端 ​

csharp
public List<AnimatedImageFrame> Frames { get; set; }

动画帧列表

LayerDefines 双端 ​

csharp
public List<AnimatedImageLayerDefine> LayerDefines { get; set; }

层定义列表,定义各图层的全局属性

AnimationTags 双端 ​

csharp
public List<AnimatedImageAnimationTag> AnimationTags { get; set; }

动画标签列表,定义命名的子动画片段

FramesPerRow 双端 ​

csharp
public int FramesPerRow { get; set; }

每行的图元数量,用于图集换行查询。 当图集中的图元按行排列时,可通过此属性计算图元的行列位置: 列索引 = 帧索引 % FramesPerRow 行索引 = 帧索引 / FramesPerRow 如果为 0 或负数,则假设所有图元在同一行。

GlobalScale 双端 ​

csharp
public Vector2 GlobalScale { get; set; }

全局缩放系数

GlobalSpeed 双端 ​

csharp
public float GlobalSpeed { get; set; }

全局播放速度系数

FallbackFrameIndex 双端 ​

csharp
public int? FallbackFrameIndex { get; set; }

回退帧索引,当动画结束且 EndBehavior 设置为 FallbackToDefault 时使用。 如果为 null 或索引无效,则回退到当前动画的第一帧。

DebugConfig 双端 ​

csharp
public AnimatedImageDebugConfig DebugConfig { get; set; }

调试配置,用于在开发时可视化动画的各种属性。 默认不启用调试绘制,可通过设置 Enabled 或 DebugDraw 开启。

AnimatedImageLoopDirection 双端 ​

命名空间 GameCore.Animation.Data.Enum

csharp
public enum AnimatedImageLoopDirection

枚举值 ​

  • Forward
  • Backward
  • PingPong
  • PingPongFromEnd

AnimationEndBehavior 双端 ​

命名空间 GameCore.Animation.Data.Enum

csharp
public enum AnimationEndBehavior

动画结束后的行为

枚举值 ​

  • StopAtLastFrame — 维持在最后一帧
  • Hide — 隐藏(不渲染)
  • FallbackToDefault — 回退到默认动画(需要设置默认动画名称)

AnimatedImageAnimationTag 双端 ​

命名空间 GameCore.Animation.Data.Struct

csharp
public class AnimatedImageAnimationTag

动画标签,定义命名的子动画片段

构造函数 ​

AnimatedImageAnimationTag 双端 ​

csharp
public AnimatedImageAnimationTag()

属性 ​

Name 双端 ​

csharp
public required string Name { get; set; }

动画标签名称

FromFrame 双端 ​

csharp
public int FromFrame { get; set; }

起始帧索引(包含)

ToFrame 双端 ​

csharp
public int ToFrame { get; set; }

结束帧索引(包含)

LoopDirection 双端 ​

csharp
public AnimatedImageLoopDirection LoopDirection { get; set; }

循环播放方向

LoopCount 双端 ​

csharp
public int LoopCount { get; set; }

循环次数,0 表示无限循环

EndBehavior 双端 ​

csharp
public AnimationEndBehavior EndBehavior { get; set; }

动画结束后的行为,默认为维持在最后一帧

AnimatedImageDebugConfig 双端 ​

命名空间 GameCore.Animation.Data.Struct

csharp
public class AnimatedImageDebugConfig

动画调试配置,用于在开发时可视化动画的各种属性

构造函数 ​

AnimatedImageDebugConfig 双端 ​

csharp
public AnimatedImageDebugConfig()

属性 ​

Enabled 双端 ​

csharp
public bool Enabled { get; set; }

是否启用调试绘制

CanvasColor 双端 ​

csharp
public Color CanvasColor { get; set; }

画布边界的颜色,默认为蓝色半透明

PivotColor 双端 ​

csharp
public Color PivotColor { get; set; }

锚点标记的颜色,默认为红色

LayerColor 双端 ​

csharp
public Color LayerColor { get; set; }

图层边界的颜色,默认为洋红色

PivotCrossSize 双端 ​

csharp
public float PivotCrossSize { get; set; }

锚点十字标记的大小(像素),默认为 10

PivotCircleRadius 双端 ​

csharp
public float PivotCircleRadius { get; set; }

锚点圆形的半径(像素),默认为 4

AnimatedImageFrame 双端 ​

命名空间 GameCore.Animation.Data.Struct

csharp
public class AnimatedImageFrame

动画帧数据

构造函数 ​

AnimatedImageFrame 双端 ​

csharp
public AnimatedImageFrame()

属性 ​

Pivot 双端 ​

csharp
public PointF Pivot { get; set; }

该帧的锚点,使用归一化坐标(0-1),默认为 (0.5, 1.0) 表示底部中心。 用于定位、旋转和缩放的基准点。 底部中心适合游戏角色动画,使角色脚底对齐地面。

Layers 双端 ​

csharp
public List<AnimatedImageFrameLayer> Layers { get; set; }

该帧包含的图层列表

DurationInMilliseconds 双端 ​

csharp
public int DurationInMilliseconds { get; set; }

该帧的持续时间(毫秒)

AnimatedImageFrameLayer 双端 ​

命名空间 GameCore.Animation.Data.Struct

csharp
public class AnimatedImageFrameLayer

构造函数 ​

AnimatedImageFrameLayer 双端 ​

csharp
public AnimatedImageFrameLayer()

属性 ​

LayerDefine 双端 ​

csharp
public int LayerDefine { get; set; }

层定义索引,指向LayerDefines 中的层定义

Opacity 双端 ​

csharp
public float Opacity { get; set; }

透明度,范围为0.0到1.0,默认为1.0(完全不透明),会与层定义的透明度相乘

Rect 双端 ​

csharp
public Rectangle Rect { get; set; }

图层矩形,定义图层在帧画布中的位置和尺寸,单位为像素。 X、Y:图层在帧画布中的绘制位置 Width、Height:从图集中裁剪的区域尺寸 注意:当 FramesPerRow 大于 0 时, 会根据帧索引自动计算图集偏移。

AnimatedImageLayerDefine 双端 ​

命名空间 GameCore.Animation.Data.Struct

csharp
public class AnimatedImageLayerDefine

构造函数 ​

AnimatedImageLayerDefine 双端 ​

csharp
public AnimatedImageLayerDefine()

属性 ​

Name 双端 ​

csharp
public required string Name { get; set; }

Enabled 双端 ​

csharp
public bool Enabled { get; set; }

Scale 双端 ​

csharp
public float Scale { get; set; }

Opacity 双端 ​

csharp
public float Opacity { get; set; }

RenderPriority 双端 ​

csharp
public int RenderPriority { get; set; }

BackEase 双端 ​

命名空间 GameCore.Animation.EasingFunction

csharp
public class BackEase : EasingFunctionBase

This class implements an easing function that backs up before going to the destination.

构造函数 ​

BackEase 双端 ​

csharp
public BackEase()

属性 ​

Amplitude 双端 ​

csharp
public double Amplitude { get; init; }

Specifies how much the function will pull back

方法 ​

EaseInCore 双端 ​

csharp
protected override double EaseInCore(double normalizedTime)

BounceEase 双端 ​

命名空间 GameCore.Animation.EasingFunction

csharp
public class BounceEase : EasingFunctionBase

This class implements an easing function that can be used to simulate bouncing

构造函数 ​

BounceEase 双端 ​

csharp
public BounceEase()

属性 ​

Bounces 双端 ​

csharp
public int Bounces { get; init; }

Specifies the number of bounces. This does not include the final half bounce.

Bounciness 双端 ​

csharp
public double Bounciness { get; init; }

Specifies the amount of bounciness. This corresponds to the scale difference between a bounce and the next bounce.
For example, Bounciness = 2.0 corresponds to the next bounce being twice as high and taking twice as long.

方法 ​

EaseInCore 双端 ​

csharp
protected override double EaseInCore(double normalizedTime)

CircleEase 双端 ​

命名空间 GameCore.Animation.EasingFunction

csharp
public class CircleEase : EasingFunctionBase

This class implements an easing function that gives a circular curve toward the destination.

构造函数 ​

CircleEase 双端 ​

csharp
public CircleEase()

方法 ​

EaseInCore 双端 ​

csharp
protected override double EaseInCore(double normalizedTime)

CubicEase 双端 ​

命名空间 GameCore.Animation.EasingFunction

csharp
public class CubicEase : EasingFunctionBase

This class implements an easing function that gives a cubic curve toward the destination

构造函数 ​

CubicEase 双端 ​

csharp
public CubicEase()

方法 ​

EaseInCore 双端 ​

csharp
protected override double EaseInCore(double normalizedTime)

EasingFunctionBase 双端 ​

命名空间 GameCore.Animation.EasingFunction

csharp
public abstract class EasingFunctionBase : IEasingFunction

构造函数 ​

EasingFunctionBase 双端 ​

csharp
protected EasingFunctionBase()

属性 ​

EasingMode 双端 ​

csharp
public EasingMode EasingMode { get; init; }

方法 ​

Ease 双端 ​

csharp
public double Ease(double normalizedTime)

EaseInCore 双端 ​

csharp
protected abstract double EaseInCore(double normalizedTime)

ElasticEase 双端 ​

命名空间 GameCore.Animation.EasingFunction

csharp
public class ElasticEase : EasingFunctionBase

This class implements an easing function that gives an elastic/springy curve

构造函数 ​

ElasticEase 双端 ​

csharp
public ElasticEase()

属性 ​

Oscillations 双端 ​

csharp
public int Oscillations { get; init; }

Specifies the number of oscillations

Springiness 双端 ​

csharp
public double Springiness { get; init; }

Specifies the amount of springiness

方法 ​

EaseInCore 双端 ​

csharp
protected override double EaseInCore(double normalizedTime)

ExponentialEase 双端 ​

命名空间 GameCore.Animation.EasingFunction

csharp
public class ExponentialEase : EasingFunctionBase

This class implements an easing function that gives an exponential curve

构造函数 ​

ExponentialEase 双端 ​

csharp
public ExponentialEase()

属性 ​

Exponent 双端 ​

csharp
public double Exponent { get; init; }

Specifies the factor which controls the shape of easing.

方法 ​

EaseInCore 双端 ​

csharp
protected override double EaseInCore(double normalizedTime)

IEasingFunction 双端 ​

命名空间 GameCore.Animation.EasingFunction

csharp
public interface IEasingFunction

This interface represents a transformation of normalizedTime. Animations use it to transform their progress before computing an interpolation. Classes that implement this interface can control the pace at which an animation is performed.

方法 ​

Ease 双端 ​

csharp
double Ease(double normalizedTime)

Transforms normalized time to control the pace of an animation.

  • normalizedTime — normalized time (progress) of the animation

返回: transformed progress

PowerEase 双端 ​

命名空间 GameCore.Animation.EasingFunction

csharp
public class PowerEase : EasingFunctionBase

This class implements an easing function that gives a polynomial curve of arbitrary degree. If the curve you desire is cubic, quadratic, quartic, or quintic it is better to use the specialized easing functions.

构造函数 ​

PowerEase 双端 ​

csharp
public PowerEase()

属性 ​

Power 双端 ​

csharp
public double Power { get; init; }

Specifies the power for the polynomial equation.

方法 ​

EaseInCore 双端 ​

csharp
protected override double EaseInCore(double normalizedTime)

QuadraticEase 双端 ​

命名空间 GameCore.Animation.EasingFunction

csharp
public class QuadraticEase : EasingFunctionBase

This class implements an easing function that gives a quadratic curve toward the destination

构造函数 ​

QuadraticEase 双端 ​

csharp
public QuadraticEase()

方法 ​

EaseInCore 双端 ​

csharp
protected override double EaseInCore(double normalizedTime)

QuarticEase 双端 ​

命名空间 GameCore.Animation.EasingFunction

csharp
public class QuarticEase : EasingFunctionBase

This class implements an easing function that gives a quartic curve toward the destination

构造函数 ​

QuarticEase 双端 ​

csharp
public QuarticEase()

方法 ​

EaseInCore 双端 ​

csharp
protected override double EaseInCore(double normalizedTime)

QuinticEase 双端 ​

命名空间 GameCore.Animation.EasingFunction

csharp
public class QuinticEase : EasingFunctionBase

This class implements an easing function that gives a quintic curve toward the destination

构造函数 ​

QuinticEase 双端 ​

csharp
public QuinticEase()

方法 ​

EaseInCore 双端 ​

csharp
protected override double EaseInCore(double normalizedTime)

SineEase 双端 ​

命名空间 GameCore.Animation.EasingFunction

csharp
public class SineEase : EasingFunctionBase

构造函数 ​

SineEase 双端 ​

csharp
public SineEase()

方法 ​

EaseInCore 双端 ​

csharp
protected override double EaseInCore(double normalizedTime)

AnimationStartTimeSetType 双端 ​

命名空间 GameCore.Animation.Enum

csharp
public enum AnimationStartTimeSetType

枚举值 ​

  • FromBeginning
  • FromCurrentTime

CancelBehavior 双端 ​

命名空间 GameCore.Animation.Enum

csharp
public enum CancelBehavior

枚举值 ​

  • Hold — Keep the current value of the animation on cancel.
  • Start — Set the value to the start value of the animation on cancel.
  • End — Set the value to the end value of the animation on cancel.

EasingMode 双端 ​

命名空间 GameCore.Animation.Enum

csharp
public enum EasingMode

This enum defines the modes in which classes deriving from EasingFunctioBase can will perform their easing.

枚举值 ​

  • EaseIn
  • EaseOut
  • EaseInOut

ERepeatBehavior 双端 ​

命名空间 GameCore.Animation.Enum

csharp
public enum ERepeatBehavior

枚举值 ​

  • Count
  • Duration
  • Forever

RepeatBehavior 双端 ​

命名空间 GameCore.Animation.Enum

csharp
public readonly struct RepeatBehavior : IEquatable<RepeatBehavior>

属性 ​

Behavior 双端 ​

csharp
public ERepeatBehavior Behavior { get; init; }

Count 双端 ​

csharp
public int Count { get; init; }

Duration 双端 ​

csharp
public TimeSpan Duration { get; init; }

Forever 双端 ​

csharp
public static RepeatBehavior Forever { get; }

方法 ​

implicit operator 双端 ​

csharp
public static RepeatBehavior implicit operator(ERepeatBehavior behavior)

implicit operator 双端 ​

csharp
public static RepeatBehavior implicit operator(int count)

implicit operator 双端 ​

csharp
public static RepeatBehavior implicit operator(TimeSpan duration)

ToString 双端 ​

csharp
public override string ToString()

operator != 双端 ​

csharp
public static bool operator !=(RepeatBehavior left, RepeatBehavior right)

operator == 双端 ​

csharp
public static bool operator ==(RepeatBehavior left, RepeatBehavior right)

GetHashCode 双端 ​

csharp
public override int GetHashCode()

Equals 双端 ​

csharp
public override bool Equals(object obj)

Equals 双端 ​

csharp
public bool Equals(RepeatBehavior other)