public void Show(ActorBase actor, EmMonsterType monsterType) { if (monsterType == EmMonsterType.Normal) { return; } UIBattleActorNameCtrl item = Instantiate <UIBattleActorNameCtrl>(nameCtrlPrefab); item.transform.parent = transform; item.transform.localScale = Vector3.one; item.gameObject.SetActive(true); item.Show(actor, monsterType); nameCtrlList.Add(item); }
public void Show(ActorBase actor, EmMonsterType monsterType) { this.actor = actor; Color clr = Color.white; string prefix = ""; if (monsterType == EmMonsterType.Normal) { clr = normalNameColor; } else if (monsterType == EmMonsterType.Elite) { clr = eliteNameColor; prefix = "精英 · "; } else if (monsterType == EmMonsterType.Boss) { prefix = "领主 · "; clr = bossNameColor; } nameLabel.color = clr; nameLabel.text = prefix + actor.actorConf.charactorName; }
public void Show(DBActorAttributeConf actorConf, float maxHp, float curHp, float preHp, EmMonsterType monsterType) { string prefix = ""; if (monsterType == EmMonsterType.Elite) { prefix = "精英 · "; } else if (monsterType == EmMonsterType.Boss) { prefix = "领主 · "; } gameObject.SetActive(true); nameLvLabel.text = prefix + actorConf.charactorName + " Lv.1"; iconCtrl.Set(actorConf.portraitID); deadIconMark.SetActive(curHp == 0); hpSpriteNormal.fillAmount = curHp / maxHp; this.maxHp = maxHp; hpFrom = preHp; hpTo = curHp; hpSpriteDark.fillAmount = hpFrom / maxHp; hpAnimaTimer = 0; isPlaying = true; autoHide = curHp == 0f; }
public void ShowMonsterHP(DBActorAttributeConf actorConf, float maxHp, float curHp, float preHp, EmMonsterType monsterType) { UIHpCtrl hpCtrl = null; if (monsterType == EmMonsterType.Boss) { hpCtrl = bigHpCtrl; smallHpCtrl.gameObject.SetActive(false); } else { hpCtrl = smallHpCtrl; bigHpCtrl.gameObject.SetActive(false); } hpCtrl.gameObject.SetActive(true); hpCtrl.Show(actorConf, maxHp, curHp, preHp, monsterType); }