Files
UltimateFishing2020/Assets/Scripts/Assembly-CSharp/ControllBar.cs
2026-03-04 10:03:45 +08:00

34 lines
465 B
C#

using UnityEngine;
using UnityEngine.UI;
public class ControllBar : MonoBehaviour
{
public Image[] bars;
[Range(-1f, 1f)]
public float value;
private void Start()
{
}
private void Update()
{
if (value > 0f)
{
bars[1].fillAmount = value;
bars[0].fillAmount = 0f;
}
else if (value < 0f)
{
bars[0].fillAmount = Mathf.Abs(value);
bars[1].fillAmount = 0f;
}
else
{
bars[0].fillAmount = 0f;
bars[1].fillAmount = 0f;
}
}
}