Exemplo n.º 1
0
 //隐藏血条
 public void HideBloodBar()
 {
     if (BloodBar != null)
     {
         BloodBar.SetVisible(false);
     }
 }
Exemplo n.º 2
0
    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);
    }
Exemplo n.º 3
0
 //隐藏血条
 public void HideBloodBar()
 {
     if (BloodBar != null)
     {
         BloodBar.SetVisible(false);
         mHasLifeBar = false;
     }
 }
Exemplo n.º 4
0
        //显示血条
        public void ShowBloodBar()
        {
            if (BloodBar != null)
            {
                BloodBar.SetVisible(true);
                this.OnUpdateHp();

                //Player需要更新Mp
                if (entityType == EntityType.Player)
                {
                    BloodBarPlayer BloodBarPlayer = BloodBar as BloodBarPlayer;
                    BloodBarPlayer.UpdateMp();
                }
            }
        }