Stash half-assed work on testing scene

This commit is contained in:
Michal Pikulski
2025-11-12 11:58:01 +01:00
committed by Michal Pikulski
parent 39d5890db4
commit 4e7f774386
18 changed files with 3065 additions and 321 deletions

View File

@@ -10,10 +10,9 @@ namespace UI.CardSystem
/// Controls a vertical progress bar made of individual Image elements.
/// Fills from bottom to top and animates the newest element with a blink effect.
///
/// Setup: Place on GameObject with GridLayoutGroup (1 column, N rows).
/// Grid should have "Lower Right" corner start so first child = bottom element.
/// Setup: Place on GameObject with VerticalLayoutGroup (Reverse Arrangement enabled).
/// First child = first progress element (1/5), last child = last progress element (5/5).
/// </summary>
[RequireComponent(typeof(GridLayoutGroup))]
public class ProgressBarController : MonoBehaviour
{
[Header("Progress Elements")]
@@ -73,8 +72,8 @@ namespace UI.CardSystem
element.enabled = false;
}
// Enable elements from BOTTOM to TOP (first N elements)
// Since GridLayout starts at "Lower Right", element[0] = bottom, element[4] = top
// Enable first N elements (since first child = 1/5, last child = 5/5)
// If currentCount = 3, enable elements [0], [1], [2] (first 3 elements)
for (int i = 0; i < currentCount && i < _progressElements.Length; i++)
{
_progressElements[i].enabled = true;
@@ -82,7 +81,7 @@ namespace UI.CardSystem
Logging.Debug($"[ProgressBarController] Showing progress {currentCount}/{maxCount}");
// Blink the NEWEST element (the one we just added)
// Blink the NEWEST element (the last one we just enabled)
// Newest element is at index (currentCount - 1)
int newestIndex = currentCount - 1;
if (newestIndex >= 0 && newestIndex < _progressElements.Length && currentCount > 0)