Logo
Animation

Spinner

A flexible loading spinner animation

Overview

Spinner is a animation component used for creating loading indicators. It supports radial and directional fill animations and automatically animates when enabled. Depending on the selected style, it can rotate continuously or play a smooth ping pong fill animation.

Preview

Properties

NameTypeDescription
spinnerStyleSpinnerStyleControls the animation mode: Radial, Horizontal, or Vertical
rotationSpeedfloatSpeed of rotation or fill progression
minFillAmountfloatMinimum fill amount used in radial animation
maxFillAmountfloatMaximum fill amount used in radial animation
spinnerImageImageReference to the Image used for the spinner

Public Methods

NameParametersDescription
StartSpinning()NoneStarts the spinning animation
StopSpinning()NoneStops the spinning animation
SetSpinnerStyle(style)SpinnerStyle styleUpdates the current style and applies configuration

Spinner Styles

StyleDescription
RadialClassic circular loading animation using rotation and fill expansion
HorizontalPing pong fill animation moving left and right
VerticalPing pong fill animation moving bottom to top

Code Example

SpinnerExample.cs
using UnityEngine;
using Evo.UI;

public class SpinnerExample : MonoBehaviour
{
    public Spinner spinner;

    void YourMethod()
    {
        // Set style
        spinner.SetSpinnerStyle(Spinner.SpinnerStyle.Radial);

        // Adjust speed and fill behavior
        spinner.rotationSpeed = 2f;
        spinner.minFillAmount = 0.2f;
        spinner.maxFillAmount = 0.9f;

        // Start or stop spinning
        spinner.StartSpinning();
        spinner.StopSpinning();
    }
}

On this page