Files
crtr/Assets/Cryville/Common/Unity/UI/ProgressBar.cs
2022-10-02 16:25:45 +08:00

26 lines
541 B
C#

using UnityEngine;
using UnityEngine.UI;
namespace Cryville.Common.Unity.UI {
public class ProgressBar : Slider {
[SerializeField][Range(0f, 1f)]
float m_smooth = 0;
public float Smooth {
get { return m_smooth; }
set { m_smooth = value; }
}
[SerializeField]
float m_targetValue;
public override float value {
get { return base.value; }
set { m_targetValue = value; }
}
protected override void Update() {
base.value = (base.value - m_targetValue) * m_smooth + m_targetValue;
base.Update();
}
}
}