Table of Contents

Class SpinnerHandler

Namespace
Fallencake.UI
Assembly
Fallencake.UI.dll

Base implementation of ISpinnerHandler that manages a set of UISpinner wrappers and coordinates their start/stop, timing and layout queries.

public abstract class SpinnerHandler : ISpinnerHandler
Inheritance
object
SpinnerHandler
Implements
Derived

Fields

_elementsAmount

protected int _elementsAmount

Field Value

int

_isInitialized

protected bool _isInitialized

Field Value

bool

_size

protected Vector2 _size

Field Value

Vector2

_spinner

protected ModularSpinner _spinner

Field Value

ModularSpinner

_spinners

protected List<UISpinner> _spinners

Field Value

List<UISpinner>

Properties

_allNotSpinning

protected bool _allNotSpinning { get; }

Property Value

bool

elementStartPosition

Initial layout policy for elements.

public ElementStartPosition elementStartPosition { get; }

Property Value

ElementStartPosition

elementsAmount

Number of managed spinning elements.

public int elementsAmount { get; }

Property Value

int

facingDirection

Facing direction used when isLookForward is true.

public FacingDirection facingDirection { get; }

Property Value

FacingDirection

isClockwise

Whether rotation is clockwise.

public bool isClockwise { get; }

Property Value

bool

isContinuousSpin

Whether continuous spinning mode is enabled.

public bool isContinuousSpin { get; }

Property Value

bool

isLookForward

Whether elements rotate to face forward along their path.

public bool isLookForward { get; }

Property Value

bool

isSimpleDelay

Whether a simplified delay model is active.

public bool isSimpleDelay { get; }

Property Value

bool

movementCurve

Easing curve for element movement.

public AnimationCurve movementCurve { get; }

Property Value

AnimationCurve

rotationDelay

Delay between starts of subsequent elements.

public float rotationDelay { get; }

Property Value

float

rotationTime

Duration (seconds) for one full rotation.

public float rotationTime { get; }

Property Value

float

size

Computed layout size used for positioning.

public Vector2 size { get; }

Property Value

Vector2

startAngle

Base rotation angle in degrees.

public int startAngle { get; }

Property Value

int

Methods

CalculateAreaSize()

Calculates layout size used for positioning.

public abstract void CalculateAreaSize()

GetFirstCompletedElementSpeed()

Returns rotation speed of the first element that completed rotation.

public float GetFirstCompletedElementSpeed()

Returns

float

GetSpinner(int)

Gets the wrapper spinner for an element by index.

public UISpinner GetSpinner(int index)

Parameters

index int

Element index.

Returns

UISpinner

HasFirstElementCompletedRotation()

Checks whether any element has completed its first rotation.

public bool HasFirstElementCompletedRotation()

Returns

bool

InitSpinners()

Creates/initializes UISpinner wrappers for each element.

public void InitSpinners()

Initialize()

Initializes internal state and places elements.

public abstract void Initialize()

MoveTangently(int)

Moves an element along the tangent of the path (per frame update).

public abstract void MoveTangently(int index)

Parameters

index int

SetElementsStartPosition()

Places elements to their start positions.

public abstract void SetElementsStartPosition()

Spin()

Starts a spin sequence according to handler policy.

public void Spin()

StartSynchronizedContinuousSpin(float)

Starts continuous spinning for all elements with the provided synchronized speed.

public void StartSynchronizedContinuousSpin(float synchronizedSpeed)

Parameters

synchronizedSpeed float

Speed value to apply to all elements.

Stop()

Stops the current spin.

public void Stop()

StopImmediate()

Stops immediately without transitions.

public void StopImmediate()