Beispiel #1
0
 void Update()
 {
     if (m_eCountDownType == eCountDownType.eCDT_None)
     {
         return;
     }
     m_fCountDown -= Time.deltaTime;
     if (m_fCountDown < 0.0f && m_eCountDownType == eCountDownType.eCDT_pvpReady)
     {
         m_fCountDown     = ms_pkTime;
         m_eCountDownType = eCountDownType.eCDT_pvp;
         sdUICharacter.Instance.ShowCountDownTime2(false);
         sdUICharacter.Instance.ShowCountDownTime(true, eCountDownType.eCDT_pvp);
     }
     if (m_eCountDownType == eCountDownType.eCDT_pvp && m_fCountDown < 0.0f)
     {
         m_eCountDownType = eCountDownType.eCDT_None;
         PKStop();
         sdPVPMsg.Send_CSID_PVP_RETULT_REQ(1, 1);
     }
     if (m_Fightui == null)
     {
         //初始化血条aaa
         GameObject ui = GameObject.Find("FightUi");
         if (ui != null && m_pvpRival != null)
         {
             int iMonsterHPType = 0;
             int iHpBarNum      = 1;
             int iMaxHp         = m_pvpRival.GetMaxHP();
             sdUICharacter.Instance.SetMonsterMaxHp(iMonsterHPType, iMaxHp, iHpBarNum);
             m_Fightui = ui.GetComponent <sdFightUi>();
             m_Fightui.ShowMonsterHp();
             m_Fightui.SetBossName(m_pvpRival.Name);
         }
     }
     else
     {
         //血条更新
         if (m_pvpRival != null)
         {
             Hashtable uiValueDesc = new Hashtable();
             uiValueDesc["value"] = m_pvpRival.GetCurrentHP();
             uiValueDesc["des"]   = "";
             sdUICharacter.Instance.SetProperty("MonsterHp", uiValueDesc);
             if (m_pvpRival.GetCurrentHP() <= 0)
             {
                 m_Fightui.HideMonsterHp();
             }
         }
     }
 }
Beispiel #2
0
    void Update()
    {
        if (currentActiveId >= 0 && currentActiveId < monsters.Length && monsters[currentActiveId] != null)
        {
            if (fightUi == null)
            {
                GameObject ui = UnityEngine.GameObject.Find("FightUi");
                if (ui != null)
                {
                    fightUi = ui.GetComponent <sdFightUi>();
                }
            }

            if (fightUi != null)
            {
                if (monsters[currentActiveId].GetAbility() >= HeaderProto.EMonsterAbility.MONSTER_ABILITY_boss)
                {
                    Hashtable uiValueDesc = new Hashtable();
                    uiValueDesc["value"] = monsters[currentActiveId].GetCurrentHP();
                    uiValueDesc["des"]   = "";
                    sdUICharacter.Instance.SetProperty("MonsterHp", uiValueDesc);
                    sdActGameMgr.Instance.m_uuLapBossNowBlood = monsters[currentActiveId].GetCurrentHP();

                    //结算之后,需要重新刷BOSS的血量..
                    if (sdActGameMsg.bNeedResetWorldBossHP)
                    {
                        monsters[currentActiveId].SetCurrentHP(sdActGameMgr.Instance.m_uuWorldBossNowBlood);
                        sdActGameMsg.bNeedResetWorldBossHP = false;
                    }
                    else
                    {
                        sdActGameMgr.Instance.m_uuWorldBossNowBlood = monsters[currentActiveId].GetCurrentHP();
                    }

                    if (monsters[currentActiveId].GetCurrentHP() <= 0)
                    {
                        fightUi.HideMonsterHp();
                    }
                }
            }
        }
    }