Files
Gen_Hack-and-Slash-Roguelite/Client/Assets/Scripts/Prefab/ProgressBarPrefab.cs

18 lines
466 B
C#
Raw Normal View History

using UnityEngine;
namespace Prefab
{
2025-08-28 16:20:24 +08:00
public class ProgressBarPrefab : MonoBehaviour
{
public GameObject _progress;
public float Progress
{
get => _progress.transform.localScale.x;
set
{
2025-08-28 16:20:24 +08:00
var x = Mathf.Clamp01(value);
_progress.transform.localScale = new Vector3(x, _progress.transform.localScale.y, _progress.transform.localScale.z);
}
}
}
}