Skip to content

Instantly share code, notes, and snippets.

Last active Aug 31, 2022
What would you like to do?
Exposes runtime progress bar for UIToolkit for Unity 2020.3.
/** Using UIElements and want to use UIToolkit's progress bar at runtime? Hope,
you're using Unity 2021.1 or later. If you aren't, you can expose the
progress bar in Unity 2020.3 and perhaps even earlier versions (not tested).
`com.unity.ui v1.0.0-preview.18` uses the following #ifdef for the
`ProgressBar` class[1]:
We use our own #ifdef for 2020.3 or later but exclude it for 2021 and later
so it doesn't conflict with `com.unity.ui`'s actual ProgressBar.
#if !UIE_PACKAGE || UNITY_2020_3_OR_NEWER && ! UNITY_2021_1_OR_NEWER
using UnityEngine.Scripting.APIUpdating;
namespace UnityEngine.UIElements
/// <summary>
/// A control that displays the progress between a lower and upper bound value.
/// </summary>
[MovedFrom(true, "UnityEditor.UIElements", "UnityEditor.UIElementsModule")]
public class ProgressBar : AbstractProgressBar
/// <undoc/>
public new class UxmlFactory : UxmlFactory<ProgressBar, UxmlTraits> {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment