//隐藏血条 public void HideBloodBar() { if (BloodBar != null) { BloodBar.SetVisible(false); } }
public void showHeroLifePlate(GOAppear.AppearInfo info) { String path = null; if (GameStart.heroid == info.obj_type_id) { path = "Prefab/HeroLifePlateGreen"; } else { path = "Prefab/HeroLifePlateRed"; } if (mHasLifeBar) { BloodBar.SetVisible(true); return; } mHasLifeBar = true; GameObject heroLifeModel = Resources.Load(path) as GameObject; heroLife = GameObject.Instantiate(heroLifeModel) as GameObject; heroLifeDic.Add((int)info.obj_type_id, heroLife); hpSprite = heroLife.transform.Find("Control_Hp/Foreground").GetComponent <UISprite>();//绿 mpSprite = heroLife.transform.Find("Control_Mp/Foreground").GetComponent <UISprite>(); //Debug.LogError("showHeroLifePlate" + info.obj_type_id); }
//隐藏血条 public void HideBloodBar() { if (BloodBar != null) { BloodBar.SetVisible(false); mHasLifeBar = false; } }
//显示血条 public void ShowBloodBar() { if (BloodBar != null) { BloodBar.SetVisible(true); this.OnUpdateHp(); //Player需要更新Mp if (entityType == EntityType.Player) { BloodBarPlayer BloodBarPlayer = BloodBar as BloodBarPlayer; BloodBarPlayer.UpdateMp(); } } }