Class AtomSpinner
- Namespace
- Fallencake.UI
- Assembly
- Fallencake.UI.dll
Stylized loading spinner composed of multiple orbital elements configured by AtomSpinnerParameters.
public class AtomSpinner : UIBehaviour, ISpinner
- Inheritance
-
objectObjectComponentBehaviourMonoBehaviourUIBehaviourAtomSpinner
- Implements
Remarks
Creates and lays out individual ModularSpinner instances and their orbit visuals, computing per-element angles and start offsets. Provides Spin() and Stop() to control animation.
Methods
CalculateRotationAngles(int)
Calculates per-element rotation angles for layout around the orbit.
public List<float> CalculateRotationAngles(int numberOfElements)
Parameters
numberOfElementsintHow many elements should be positioned.
Returns
- List<float>
List of Z-rotation angles in degrees.
CalculateStartAngles(int)
Calculates per-element starting angles to seed spinner initial rotations.
public List<int> CalculateStartAngles(int numberOfElements)
Parameters
numberOfElementsintHow many elements to seed.
Returns
- List<int>
List of angles in degrees for initial rotation states.
Initialize()
Builds and (re)initializes spinners and orbits according to current parameters.
public void Initialize()
InitializeElement(AtomSpinnerParameters, int)
Initializes a specific element (spinner + orbit) at the given index.
public void InitializeElement(AtomSpinnerParameters elementParameters, int index)
Parameters
elementParametersAtomSpinnerParametersConfiguration bundle for the element.
indexintIndex of the element to initialize.
Spin()
Starts or continues the spinning animation.
public void Spin()
Start()
protected override void Start()
Stop()
Stops the spinning animation.
public void Stop()