Merge branch 'main' of https://homelab.tailf7f81b.ts.net/tschesky/AppleHillsProduction
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Core.Lifecycle;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
@@ -9,7 +10,7 @@ namespace Minigames.CardSorting.UI
|
||||
/// Displays and animates lives for the card sorting minigame.
|
||||
/// Manages a layout group of life icons with add/remove animations.
|
||||
/// </summary>
|
||||
public class LivesDisplay : MonoBehaviour
|
||||
public class LivesDisplay : ManagedBehaviour
|
||||
{
|
||||
[Header("Configuration")]
|
||||
[SerializeField] private LayoutGroup layoutGroup;
|
||||
@@ -21,7 +22,11 @@ namespace Minigames.CardSorting.UI
|
||||
private GameObject lifeIconPrefab;
|
||||
private List<GameObject> lifeIcons = new List<GameObject>();
|
||||
|
||||
private void Awake()
|
||||
/// <summary>
|
||||
/// Initialize the display with the maximum number of lives.
|
||||
/// Clones the prefab element multiple times.
|
||||
/// </summary>
|
||||
public void Initialize(int maxLives)
|
||||
{
|
||||
if (layoutGroup == null)
|
||||
{
|
||||
@@ -33,14 +38,7 @@ namespace Minigames.CardSorting.UI
|
||||
{
|
||||
lifeIconPrefab = layoutGroup.transform.GetChild(0).gameObject;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initialize the display with the maximum number of lives.
|
||||
/// Clones the prefab element multiple times.
|
||||
/// </summary>
|
||||
public void Initialize(int maxLives)
|
||||
{
|
||||
|
||||
// Clear existing lives
|
||||
ClearAllLives();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user