using System.Collections; using System.Collections.Generic; using UnityEngine; public class BossInfoUI : MonoBehaviour { public UILabel label_bossname; public UISlider slider_bosshp; public void Set(string _bossname = null) { var active = !string.IsNullOrEmpty(_bossname); gameObject.SetActive(active); if (active) { Set_HP(1, 1); label_bossname.text = _bossname; } } public void Set_HP(double _hp, double _maxhp) { slider_bosshp.value = (float)(_hp / _maxhp); } }