Ejemplo n.º 1
0
        //创建血条
        public void CreateBloodBar(ObjectHero hero)
        {
            Transform tans = hero.GetAnimation().EventControl.Pre_Head_T_EffectPoint;

            GameObject barObj = Instantiate(UI_FightControler.Inst.heroBloodPre, Vector3.zero, Quaternion.identity) as GameObject;

            barObj.transform.SetParent(transform, false);
            UI_Blood mBlood = barObj.AddComponent <UI_Blood>();

            mBlood.SetPosition(tans.position);
            barObj.transform.localScale = new Vector3(1, 1, 1);
            bloodInfo.Add(mBlood);
            mBlood.isHero = true;
            mBlood.setHeroLevel(hero.GetHeroData().Level);
            if (!ObjectSelf.GetInstance().LimitFightMgr.m_bStartEnter)
            {
                hero.SetHP(hero.GetMaxHP());
            }
            mBlood.SetValue((float)hero.GetHP() / (float)hero.GetMaxHP());
            mBlood.setHeadPosition(tans);
            mBlood.uid.Copy(hero.GetGuid());
        }