Skip to content

AnimationField

StructChartGuruChartGuru
public struct AnimationField

Serializable wrapper around an optional ChartGuru.Animation. Unity cannot serialize Animation? directly, so components expose this struct in their inspector. When ChartGuru.AnimationField.Enabled is false, the value is treated as null.

public static AnimationField Enable(Animation animation)

A field wrapping the supplied animation.

Parameters

Name Type
animation ChartGuru.Animation

Returns

ChartGuru.AnimationField

public Animation? ToNullable()

Returns the configured animation when enabled, or no animation when the serialized field is disabled.

Returns

System.Nullable{ChartGuru.Animation}

public static AnimationField FromNullable(Animation? animation)

Creates an inspector-friendly animation field from an optional runtime animation.

Parameters

Name Type
animation System.Nullable{ChartGuru.Animation}

Returns

ChartGuru.AnimationField

public AnimationField WithAnimation(Animation animation)

Returns a copy that uses the supplied animation while preserving the enabled state.

Parameters

Name Type
animation ChartGuru.Animation

Returns

ChartGuru.AnimationField

public AnimationField WithEnabled(bool enabled)

Returns a copy with animation playback enabled or disabled without discarding its animation settings.

Parameters

Name Type
enabled System.Boolean

Returns

ChartGuru.AnimationField

public bool Equals(AnimationField other)

Parameters

Name Type
other ChartGuru.AnimationField

Returns

System.Boolean

public override bool Equals(object obj)

Parameters

Name Type
obj System.Object

Returns

System.Boolean

public override int GetHashCode()

Returns

System.Int32

public bool Enabled { get; }

Returns

System.Boolean

public Animation Value { get; }

Returns

ChartGuru.Animation

public static AnimationField Disabled { get; }

A field configured to run no Animation (instant apply).

Returns

ChartGuru.AnimationField