Logo
UI Elements

Progress Button

Hold a button to complete an action

Overview

Progress Button requires a sustained press before completing an action. It is useful for confirmations where an ordinary click would be too easy to trigger.

Preview

Usage

Create a Progress Button prefab.

Set Hold Duration and assign a Procedural Shape as Progress Fill.

Connect the action to On Complete.

Choose whether completion remains visible or resets after a delay.


Tips

  • The progress and reset curves control the fill animation.
  • Stay On Complete keeps the finished state visible; otherwise Complete State Duration controls its delay.
  • Configure fill direction on the Procedural Shape.

Public API

Use ProgressButton in the Evo.UI namespace.

Properties

NameTypeDescription
CurrentProgressfloatRead-only normalized progress.
CurrentProgressStateProgressStateRead-only Normal, InProgress, or Complete state.
IsHoldingboolWhether a hold is active.

Fields

NameTypeDescription
holdDurationfloatSeconds required to complete a hold.
resetDurationfloatTime used to return the fill after cancellation.
progressFillProceduralShapeProcedural Shape used to display progress.

Methods

NameParametersDescription
StartProgress()NoneBegins a hold.
CancelProgress()NoneCancels the current hold.
CompleteProgress()NoneCompletes the action immediately.
ResetProgress()bool instantResets the state, optionally without animation.
SetProgress()float progressSets normalized progress.

Events

NameTypeDescription
onProgressStartUnityEventHold started.
onProgressUpdateUnityEvent<float>Normalized progress changed.
onCompleteUnityEventThe action completed.
onCancelUnityEventThe hold was cancelled.

Example

ProgressButtonExample.cs
using UnityEngine;
using Evo.UI;

public class ProgressButtonExample : MonoBehaviour
{
    [SerializeField] private ProgressButton target;

    private void Start()
    {
        target.holdDuration = 1.5f;
        target.onComplete.AddListener(() => Debug.Log("Confirmed"));
    }
}

On this page