public override void OnTriggerHitted(GameObject obj, int[] param) { base.OnTriggerHitted(obj, param); if (param[3] < 0) { return; } currentActiveId = param[3]; if (fightUi == null) { GameObject ui = UnityEngine.GameObject.Find("FightUi"); if (ui != null) { fightUi = ui.GetComponent <sdFightUi>(); } } if (fightUi != null && currentActiveId < monsters.Length && monsters[currentActiveId] != null) { if (monsters[currentActiveId].GetAbility() >= HeaderProto.EMonsterAbility.MONSTER_ABILITY_boss) { sdTuiTuLogic ttLogic = sdGameLevel.instance.tuiTuLogic; //ttLogic.cameraShaker.AddRandomCameraShake(0.5f,0.5f,80.0f,1.0f); // 小BOSS和大BOSS的血条样式不同aa int iMonsterHPType = 0; if (monsters[currentActiveId].GetAbility() == HeaderProto.EMonsterAbility.MONSTER_ABILITY_boss_large) { iMonsterHPType = 1; } // 呼出血条,血条初始化.. int iHpBarNum = monsters[currentActiveId].GetHPBarNum(); int iMaxHP = monsters[currentActiveId].GetMaxHP(); sdUICharacter.Instance.SetMonsterMaxHp(iMonsterHPType, iMaxHP, iHpBarNum); fightUi.ShowMonsterHp(); //深渊boss需要再设置一下当前血量,因为Boss有残血的可能.. if (monsters[currentActiveId].isLapBoss) { Hashtable uiValueDesc = new Hashtable(); uiValueDesc["value"] = monsters[currentActiveId].GetCurrentHP(); uiValueDesc["des"] = ""; sdUICharacter.Instance.SetProperty("MonsterHp", uiValueDesc); } //设置boss名字.. fightUi.SetBossName(monsters[currentActiveId].GetName()); } } }
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(); } } } }