using UnityEngine; namespace SplashEdit.RuntimeCode { /// /// A progress bar UI element for PSX export. /// Rendered as two FastFill primitives (background + fill) on PS1 hardware. /// Attach to a child of a PSXCanvas GameObject. /// [RequireComponent(typeof(RectTransform))] [DisallowMultipleComponent] [AddComponentMenu("PSX/UI/PSX UI Progress Bar")] [Icon("Packages/net.psxsplash.splashedit/Icons/PSXUIProgressBar.png")] public class PSXUIProgressBar : MonoBehaviour { [Tooltip("Name used to reference this element from Lua (max 24 chars).")] [SerializeField] private string elementName = "progress"; [Tooltip("Background color (shown behind the fill).")] [SerializeField] private Color backgroundColor = new Color(0.2f, 0.2f, 0.2f); [Tooltip("Fill color (the progressing portion).")] [SerializeField] private Color fillColor = Color.green; [Tooltip("Initial progress value (0-100).")] [Range(0, 100)] [SerializeField] private int initialValue = 0; [Tooltip("Whether this element is visible when the scene first loads.")] [SerializeField] private bool startVisible = true; /// Element name for Lua access. public string ElementName => elementName; /// Background color (RGB). public Color BackgroundColor => backgroundColor; /// Fill color (RGB). public Color FillColor => fillColor; /// Initial progress value 0-100. public int InitialValue => Mathf.Clamp(initialValue, 0, 100); /// Initial visibility flag. public bool StartVisible => startVisible; } }