/// <summary> /// 设置头部 UI 信息 /// </summary> private void SetupTag() { var ib = GetComponentInChildren <InfoBar>(); _infoBar = ib.gameObject; _infoBarRect = _infoBar.GetComponent <RectTransform>(); ib.SetupInfo(new InfoData(Level.L1, actorName)); _hpBar = GetComponentInChildren <HpBar>(); _hpBarRect = _hpBar.GetComponent <RectTransform>(); _hpBar.SetMaxHp(health.health); UpdateHpBar(health.health); }
void Awake() { status_text = StatusText.GetComponent <Text>(); healthbar = HpBar.GetComponent <Transform>().FindChild("HealthBar").GetComponent <Image>(); }