using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; /* -------------------------------------- Project: Programing assessment Standard: 91906 (AS3.7) v.1 School: Tauranga Boys' College Author: Rauputu Noah Phizacklea Date: August 2024 Unity: 2021.3.18f --------------------------------------- */ public class StaminaBar : MonoBehaviour { public Slider slider; // The UI Slider component representing the stamina bar // Method to set the maximum value of the stamina bar and initialize it public void SetMaxStamina(int stamina) { slider.maxValue = stamina; // Set the slider's maximum value slider.value = stamina; // Initialize the slider's value to max stamina } // Method to update the stamina bar with the current stamina value public void SetStamina(int stamina) { slider.value = stamina; // Update the slider's value to the current stamina } }