UGUI使用Slider
using UnityEngine.UI; public Slider m_Slider; void Update () { m_Slider.value = (float)life / 100;