490 lines
17 KiB
C#
490 lines
17 KiB
C#
|
using Games.GlobeDefine;
|
|||
|
using UnityEngine;
|
|||
|
using UnityEngine.UI;
|
|||
|
using System.Collections;
|
|||
|
using Games.LogicObj;
|
|||
|
using System;
|
|||
|
using GCGame;
|
|||
|
using GCGame.Table;
|
|||
|
using Games.ImpactModle;
|
|||
|
|
|||
|
public class TargetFrameLogic : MonoBehaviour {
|
|||
|
|
|||
|
private static TargetFrameLogic m_Instance = null;
|
|||
|
public static TargetFrameLogic Instance()
|
|||
|
{
|
|||
|
return m_Instance;
|
|||
|
}
|
|||
|
|
|||
|
public Text Level;
|
|||
|
public Text Blood;
|
|||
|
public Text m_TargetLevelText;
|
|||
|
public Text m_TargetName;
|
|||
|
public Text m_TargetType;
|
|||
|
public Slider _HPSlider;
|
|||
|
public Text m_TargetHPText;
|
|||
|
public Slider _MPSlider;
|
|||
|
public Text m_TargetMPText;
|
|||
|
public Image m_TargetHeadSprite;
|
|||
|
public GameObject m_BelongSprite;
|
|||
|
public GameObject m_TargetTypeObj;
|
|||
|
|
|||
|
//保存目标的某些信息
|
|||
|
private UInt64 m_TargetGuid = GlobeVar.INVALID_GUID;
|
|||
|
|
|||
|
public System.UInt64 TargetGuid
|
|||
|
{
|
|||
|
get { return m_TargetGuid; }
|
|||
|
set { m_TargetGuid = value; }
|
|||
|
}
|
|||
|
|
|||
|
private string m_strTargetName = "";
|
|||
|
public string StrTargetName
|
|||
|
{
|
|||
|
get { return m_strTargetName; }
|
|||
|
set { m_strTargetName = value; }
|
|||
|
}
|
|||
|
|
|||
|
private int m_TargetServerID = GlobeVar.INVALID_ID;
|
|||
|
public int TargetServerID
|
|||
|
{
|
|||
|
get { return m_TargetServerID; }
|
|||
|
set { m_TargetServerID = value; }
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
public bool isShowThis = false;
|
|||
|
public void OnEnable()
|
|||
|
{
|
|||
|
if (GameManager.gameManager.m_RunningScene == 658 && isShowThis == false )
|
|||
|
{
|
|||
|
this.gameObject.SetActive(false);
|
|||
|
}
|
|||
|
}
|
|||
|
void Awake()
|
|||
|
{
|
|||
|
m_Instance = this;
|
|||
|
Games.Events.EventDispatcher.Instance.Add(Games.Events.EventId.ChangeTarget, ChangeTarget);
|
|||
|
Games.Events.EventDispatcher.Instance.Add(Games.Events.EventId.TargetMP, ChangeMP);
|
|||
|
Games.Events.EventDispatcher.Instance.Add(Games.Events.EventId.TargetHP, ChangeHP);
|
|||
|
Games.Events.EventDispatcher.Instance.Add(Games.Events.EventId.CancleTarget, CancelTarget);
|
|||
|
Games.Events.EventDispatcher.Instance.Add(Games.Events.EventId.UpdateTargetBuff, UpdateBuffIcon);
|
|||
|
Games.Events.EventDispatcher.Instance.Add(Games.Events.EventId.CreateTargetHealth, CreateShield);
|
|||
|
Games.Events.EventDispatcher.Instance.Add(Games.Events.EventId.UpdateTargetHealth, UpdateShield);
|
|||
|
Games.Events.EventDispatcher.Instance.Add(Games.Events.EventId.RemoveTargetHealth, RemoveShield);
|
|||
|
|
|||
|
ShieldOnAwake();
|
|||
|
}
|
|||
|
|
|||
|
// Use this for initialization
|
|||
|
void Start () {
|
|||
|
HideTargetFrame();
|
|||
|
m_TargetLevelText.text = "0";
|
|||
|
m_TargetHPText.text = "0/0";
|
|||
|
_HPSlider.value = 0;
|
|||
|
_MPSlider.value = 0;
|
|||
|
|
|||
|
UpdateBuffIcon(TargetServerID);
|
|||
|
}
|
|||
|
|
|||
|
// Update is called once per frame
|
|||
|
|
|||
|
void OnDestroy()
|
|||
|
{
|
|||
|
m_Instance = null;
|
|||
|
|
|||
|
Games.Events.EventDispatcher.Instance.Remove(Games.Events.EventId.ChangeTarget, ChangeTarget);
|
|||
|
Games.Events.EventDispatcher.Instance.Remove(Games.Events.EventId.TargetMP, ChangeMP);
|
|||
|
Games.Events.EventDispatcher.Instance.Remove(Games.Events.EventId.TargetHP, ChangeHP);
|
|||
|
Games.Events.EventDispatcher.Instance.Remove(Games.Events.EventId.TargetLevel, ChangeLevel);
|
|||
|
Games.Events.EventDispatcher.Instance.Remove(Games.Events.EventId.CancleTarget, CancelTarget);
|
|||
|
Games.Events.EventDispatcher.Instance.Remove(Games.Events.EventId.UpdateTargetBuff, UpdateBuffIcon);
|
|||
|
Games.Events.EventDispatcher.Instance.Remove(Games.Events.EventId.CreateTargetHealth, CreateShield);
|
|||
|
Games.Events.EventDispatcher.Instance.Remove(Games.Events.EventId.UpdateTargetHealth, UpdateShield);
|
|||
|
Games.Events.EventDispatcher.Instance.Remove(Games.Events.EventId.RemoveTargetHealth, RemoveShield);
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 切换目标
|
|||
|
/// </summary>
|
|||
|
/// <param name="targetObj">目标obj</param>
|
|||
|
public void ChangeTarget(object obj)
|
|||
|
{
|
|||
|
if (Singleton<ObjManager>.Instance.MainPlayer == null)
|
|||
|
return;
|
|||
|
if (Singleton<ObjManager>.Instance.MainPlayer.targetId == null)
|
|||
|
return;
|
|||
|
Obj_Character character = Singleton<ObjManager>.Instance.FindObjCharacterInScene(Singleton<ObjManager>.Instance.MainPlayer.targetId.Value);
|
|||
|
if (character == null)
|
|||
|
return;
|
|||
|
if ((m_TargetServerID != GlobeVar.INVALID_ID || (BossFramUI.Instance()!=null && BossFramUI.Instance().gameObject.activeSelf)) && character.ServerID == Singleton<ObjManager>.Instance.MainPlayer.ServerID)
|
|||
|
return;
|
|||
|
var roleTab = TableManager.GetRoleBaseAttrByID(character.BaseAttr.RoleBaseID, 0);
|
|||
|
if (roleTab == null || roleTab.IsShowHeadIcon != 1 || roleTab.BossBloodShowTimes > 0)
|
|||
|
{
|
|||
|
HideTargetFrame();
|
|||
|
m_TargetServerID = GlobeVar.INVALID_ID;
|
|||
|
return;
|
|||
|
}
|
|||
|
|
|||
|
if (roleTab.IsShowHeadIcon != 1 || roleTab.BossBloodShowTimes >= 1)
|
|||
|
{
|
|||
|
HideTargetFrame();
|
|||
|
m_TargetServerID = GlobeVar.INVALID_ID;
|
|||
|
return;
|
|||
|
}
|
|||
|
|
|||
|
gameObject.SetActive(true);
|
|||
|
|
|||
|
m_TargetType.text = "";
|
|||
|
m_TargetTypeObj.SetActive(true);
|
|||
|
switch (roleTab.NpcType)
|
|||
|
{
|
|||
|
case 2:
|
|||
|
case 5:
|
|||
|
m_TargetType.text = "BOSS";
|
|||
|
break;
|
|||
|
case 3:
|
|||
|
m_TargetType.text = Utils.GetDicByID(20156);
|
|||
|
break;
|
|||
|
case 4:
|
|||
|
m_TargetType.text = "NPC";
|
|||
|
break;
|
|||
|
case 0:
|
|||
|
case 1:
|
|||
|
if (CharacterDefine.NPCTypeTable.ContainsKey(roleTab.Group))
|
|||
|
m_TargetType.text = Utils.GetDicByID(CharacterDefine.NPCTypeTable[roleTab.Group]);
|
|||
|
break;
|
|||
|
}
|
|||
|
|
|||
|
m_TargetLevelText.text = character.BaseAttr.Level.ToString();
|
|||
|
m_TargetHPText.text = Utils.ConvertLargeNumToString(character.BaseAttr.HP) + "/" +
|
|||
|
Utils.ConvertLargeNumToString(character.BaseAttr.MaxHP);
|
|||
|
if (character.BaseAttr.MaxHP > 0)
|
|||
|
_HPSlider.value = character.BaseAttr.HP * 1.0f / character.BaseAttr.MaxHP;
|
|||
|
else
|
|||
|
_HPSlider.value = 0;
|
|||
|
if (character.BaseAttr.MaxMP > 0)
|
|||
|
_MPSlider.value = character.BaseAttr.MP * 1.0f / character.BaseAttr.MaxMP;
|
|||
|
else
|
|||
|
_MPSlider.value = 0;
|
|||
|
m_TargetServerID = character.ServerID;
|
|||
|
UpdateBuffIcon(character.ServerID);
|
|||
|
var otherPlayer = character as Obj_OtherPlayer;
|
|||
|
if (null != otherPlayer)
|
|||
|
{
|
|||
|
m_TargetGuid = otherPlayer.GUID;
|
|||
|
if (!string.IsNullOrEmpty(otherPlayer.BaseAttr.RoleName))
|
|||
|
{
|
|||
|
char firstChar = otherPlayer.BaseAttr.RoleName[0];
|
|||
|
if (firstChar == '#' && StrDictionary.IsServerDictionaryFormatString(otherPlayer.BaseAttr.RoleName))
|
|||
|
{
|
|||
|
otherPlayer.BaseAttr.RoleName = StrDictionary.GetServerDictionaryFormatString(otherPlayer.BaseAttr.RoleName);
|
|||
|
}
|
|||
|
}
|
|||
|
m_strTargetName = otherPlayer.BaseAttr.RoleName;
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
m_TargetGuid = GlobeVar.INVALID_GUID;
|
|||
|
m_strTargetName = "";
|
|||
|
}
|
|||
|
if(character.BaseAttr.Level <= 0 && roleTab != null)
|
|||
|
{
|
|||
|
m_TargetLevelText.text = roleTab.Level.ToString();
|
|||
|
Level.text = roleTab.Level.ToString();
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
m_TargetLevelText.text = character.BaseAttr.Level.ToString();
|
|||
|
Level.text = character.BaseAttr.Level.ToString();
|
|||
|
}
|
|||
|
SetTargetName(character);
|
|||
|
Blood.text = character.BaseAttr.HP.ToString();
|
|||
|
// 特殊处理护盾情况
|
|||
|
var npc = character as Obj_NPC;
|
|||
|
if (npc != null && npc.shieldData != null)
|
|||
|
{
|
|||
|
CreateShield(null);
|
|||
|
UpdateShield(npc);
|
|||
|
}
|
|||
|
else
|
|||
|
RemoveShield(character);
|
|||
|
ChangeMP(character);
|
|||
|
LoadAssetBundle.Instance.SetImageSprite(m_TargetHeadSprite,
|
|||
|
otherPlayer != null ? Utils.GetProfessionSpriteName(otherPlayer.Profession) : character.BaseAttr.HeadPic);
|
|||
|
}
|
|||
|
|
|||
|
public void ChangeMP(object obj)
|
|||
|
{
|
|||
|
Obj_Character targetObj = obj as Obj_Character;
|
|||
|
if (targetObj == null || targetObj.ServerID != m_TargetServerID || gameObject.activeSelf==false)
|
|||
|
return;
|
|||
|
|
|||
|
if (targetObj.ObjType == GameDefine_Globe.OBJ_TYPE.OBJ_MAIN_PLAYER ||
|
|||
|
targetObj.ObjType == GameDefine_Globe.OBJ_TYPE.OBJ_OTHER_PLAYER ||
|
|||
|
targetObj.ObjType == GameDefine_Globe.OBJ_TYPE.OBJ_ZOMBIE_PLAYER)
|
|||
|
{
|
|||
|
Obj_OtherPlayer _Player = targetObj as Obj_OtherPlayer;
|
|||
|
if (_Player)
|
|||
|
{
|
|||
|
_MPSlider.gameObject.SetActive(true);
|
|||
|
m_TargetMPText.gameObject.SetActive(true);
|
|||
|
|
|||
|
if (targetObj.BaseAttr.MaxMP > 0)
|
|||
|
{
|
|||
|
_MPSlider.value = (float)targetObj.BaseAttr.MP / (float)targetObj.BaseAttr.MaxMP;
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
_MPSlider.value = 0;
|
|||
|
}
|
|||
|
m_TargetMPText.text = Utils.ConvertLargeNumToString(targetObj.BaseAttr.MP) + "/" + Utils.ConvertLargeNumToString(targetObj.BaseAttr.MaxMP);
|
|||
|
}
|
|||
|
m_TargetTypeObj.SetActive(false);
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
_MPSlider.gameObject.SetActive(false);
|
|||
|
m_TargetMPText.gameObject.SetActive(false);
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
public void ChangeLevel(object obj)
|
|||
|
{
|
|||
|
Obj_Character targetObj = obj as Obj_Character;
|
|||
|
if (targetObj == null || targetObj.ServerID != m_TargetServerID || gameObject.activeSelf == false)
|
|||
|
return;
|
|||
|
Level.text = targetObj.BaseAttr.Level.ToString();
|
|||
|
}
|
|||
|
|
|||
|
public void ChangeHP(object obj)
|
|||
|
{
|
|||
|
Obj_Character targetObj = obj as Obj_Character;
|
|||
|
if (targetObj == null || targetObj.ServerID != m_TargetServerID || gameObject.activeSelf==false)
|
|||
|
return;
|
|||
|
if (!_healthAsShield)
|
|||
|
{
|
|||
|
m_TargetHPText.text = Utils.ConvertLargeNumToString(targetObj.BaseAttr.HP) + "/" +
|
|||
|
Utils.ConvertLargeNumToString(targetObj.BaseAttr.MaxHP);
|
|||
|
if (targetObj.BaseAttr.MaxHP > 0)
|
|||
|
{
|
|||
|
_HPSlider.value = (float) targetObj.BaseAttr.HP / (float) targetObj.BaseAttr.MaxHP;
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
_HPSlider.value = 0;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
public void CancelTarget(object obj)
|
|||
|
{
|
|||
|
var serverId = (int) obj;
|
|||
|
if (m_TargetServerID != GlobeVar.INVALID_ID && serverId != -1 && serverId != m_TargetServerID)
|
|||
|
return;
|
|||
|
if (gameObject.activeSelf)
|
|||
|
HideTargetFrame();
|
|||
|
m_TargetGuid = GlobeVar.INVALID_GUID;
|
|||
|
m_TargetServerID = GlobeVar.INVALID_ID;
|
|||
|
m_strTargetName = "";
|
|||
|
|
|||
|
m_TargetLevelText.text = "0";
|
|||
|
m_TargetHPText.text = "0/0";
|
|||
|
_HPSlider.value = 0;
|
|||
|
_MPSlider.value = 0;
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
void ShowTargetFrame()
|
|||
|
{
|
|||
|
gameObject.SetActive(true);
|
|||
|
}
|
|||
|
|
|||
|
void HideTargetFrame()
|
|||
|
{
|
|||
|
gameObject.SetActive(false);
|
|||
|
}
|
|||
|
|
|||
|
public void OnClickTargetFrame()
|
|||
|
{
|
|||
|
//只有玩家可以弹出菜单,所以发现guid非法则不弹
|
|||
|
if (m_TargetGuid == GlobeVar.INVALID_GUID || m_strTargetName == "")
|
|||
|
{
|
|||
|
return;
|
|||
|
}
|
|||
|
|
|||
|
Obj_Character targetObj = Singleton<ObjManager>.Instance.FindObjCharacterInScene(m_TargetServerID);
|
|||
|
|
|||
|
//特殊的:关宁不弹出玩家信息
|
|||
|
if (GameManager.gameManager.RunningScene == (int)Games.GlobeDefine.GameDefine_Globe.SCENE_DEFINE.SCENE_GUANNING)
|
|||
|
{
|
|||
|
if(targetObj.BaseAttr.Force != GameManager.gameManager.PlayerDataPool.MainPlayerBaseAttr.Force)
|
|||
|
return;
|
|||
|
}
|
|||
|
|
|||
|
if (m_TargetGuid != Singleton<ObjManager>.Instance.MainPlayer.GUID)
|
|||
|
{
|
|||
|
PlayerTooltipsLogic.ShowPlayerTooltip(m_TargetGuid, m_strTargetName, targetObj.BaseAttr.HeadPic, targetObj.BaseAttr.Level, -1, targetObj.BaseAttr.CombatValue, Vector3.zero);
|
|||
|
}
|
|||
|
return;
|
|||
|
}
|
|||
|
|
|||
|
void SetTargetName(Obj_Character targetObj)
|
|||
|
{
|
|||
|
if (GameManager.gameManager.RunningScene == (int)GameDefine_Globe.SCENE_DEFINE.SCENE_GUANNING)
|
|||
|
{
|
|||
|
if (targetObj.BaseAttr.Force == 6)
|
|||
|
{
|
|||
|
m_TargetName.text = (StrDictionary.GetClientDictionaryString("#{9210}"));
|
|||
|
}
|
|||
|
else if (targetObj.BaseAttr.Force == 7)
|
|||
|
{
|
|||
|
m_TargetName.text = (StrDictionary.GetClientDictionaryString("#{9211}"));
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
m_TargetName.text = targetObj.BaseAttr.RoleName;
|
|||
|
}
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
m_TargetName.text = targetObj.BaseAttr.RoleName;
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
bool IsGuildBossNpc(Obj_Character targetObj)
|
|||
|
{
|
|||
|
if (targetObj.ObjType == GameDefine_Globe.OBJ_TYPE.OBJ_NPC)
|
|||
|
{
|
|||
|
Obj_NPC rNpc = targetObj as Obj_NPC;
|
|||
|
if (rNpc != null)
|
|||
|
{
|
|||
|
return rNpc.IsGuildActivityBoss;
|
|||
|
}
|
|||
|
}
|
|||
|
return false;
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
//目标BUFFIcon相关
|
|||
|
public Image[] m_BuffShowIcon = new Image[(int)BUFFICON.MAX_BUFFICONUM];
|
|||
|
|
|||
|
public void OnClick_BuffIcon()
|
|||
|
{
|
|||
|
UIManager.ShowUI(UIInfo.ImpactInfoWnd, OnOpenSuccess);
|
|||
|
}
|
|||
|
|
|||
|
public void OnOpenSuccess(bool success, object param)
|
|||
|
{
|
|||
|
Hashtable hash = new Hashtable();
|
|||
|
hash.Add("targetId", m_TargetServerID);
|
|||
|
Games.Events.EventDispatcher.Instance.SendMessage(Games.Events.EventId.OpenImpactInfoWndSuccess, hash);
|
|||
|
}
|
|||
|
|
|||
|
//更新头像的BUFF位
|
|||
|
public void UpdateBuffIcon(object obj)
|
|||
|
{
|
|||
|
if (gameObject.activeSelf == false)
|
|||
|
return;
|
|||
|
|
|||
|
int TargetId = (int)obj;
|
|||
|
|
|||
|
if (TargetId != m_TargetServerID)
|
|||
|
return;
|
|||
|
Obj_Character targetObj = Singleton<ObjManager>.Instance.FindObjCharacterInScene(TargetId);
|
|||
|
if (targetObj == null || targetObj.ClientImpactInfos == null)
|
|||
|
return;
|
|||
|
|
|||
|
int nBuffShowIndex = 0;
|
|||
|
for (int i = 0; i < targetObj.ClientImpactInfos.Count; ++i)
|
|||
|
{
|
|||
|
if (nBuffShowIndex >= m_BuffShowIcon.Length)
|
|||
|
break;
|
|||
|
m_BuffShowIcon[nBuffShowIndex].gameObject.SetActive(false);
|
|||
|
if (targetObj.ClientImpactInfos[i].IsVaild())
|
|||
|
{
|
|||
|
Tab_Impact _tabImpact = TableManager.GetImpactByID(targetObj.ClientImpactInfos[i].ImpactId, 0);
|
|||
|
if (_tabImpact != null)
|
|||
|
{
|
|||
|
if ( _tabImpact.BuffIcon != "-1" && _tabImpact.IsNeedNoticeClient==1)
|
|||
|
{
|
|||
|
if (nBuffShowIndex >= 0 && nBuffShowIndex < (int)BUFFICON.MAX_BUFFICONUM)
|
|||
|
{
|
|||
|
m_BuffShowIcon[nBuffShowIndex].gameObject.SetActive(true);
|
|||
|
LoadAssetBundle.Instance.SetImageSprite(m_BuffShowIcon[nBuffShowIndex], _tabImpact.BuffIcon);
|
|||
|
nBuffShowIndex++;
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
break;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
for (int i = nBuffShowIndex; i < (int)BUFFICON.MAX_BUFFICONUM; i++)
|
|||
|
{
|
|||
|
m_BuffShowIcon[i].gameObject.SetActive(false);
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
#region 护盾处理流程
|
|||
|
|
|||
|
private Image _healthBar;
|
|||
|
private Image _shieldBar;
|
|||
|
private bool _healthAsShield;
|
|||
|
|
|||
|
private void ShieldOnAwake()
|
|||
|
{
|
|||
|
_healthBar = _HPSlider.fillRect.GetComponent<Image>();
|
|||
|
_shieldBar = _HPSlider.fillRect.transform.GetChild(0).GetComponent<Image>();
|
|||
|
_healthBar.enabled = true;
|
|||
|
_shieldBar.enabled = false;
|
|||
|
}
|
|||
|
|
|||
|
public void CreateShield(object obj)
|
|||
|
{
|
|||
|
Obj_NPC targetObj = obj as Obj_NPC;
|
|||
|
if (targetObj == null || targetObj.ServerID != m_TargetServerID || targetObj.shieldData == null)
|
|||
|
return;
|
|||
|
|
|||
|
if (!_healthAsShield)
|
|||
|
{
|
|||
|
_healthAsShield = true;
|
|||
|
_healthBar.enabled = false;
|
|||
|
_shieldBar.enabled = true;
|
|||
|
_shieldBar.color = Utils.GetColorByString(StrDictionary.GetClientDictionaryString(GlobeVar.shieldColorKey));
|
|||
|
m_TargetName.text = StrDictionary.GetClientDictionaryString(GlobeVar.shieldNameKey);
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
public void UpdateShield(object obj)
|
|||
|
{
|
|||
|
Obj_NPC targetObj = obj as Obj_NPC;
|
|||
|
if (targetObj == null || targetObj.ServerID != m_TargetServerID || targetObj.shieldData == null)
|
|||
|
return;
|
|||
|
if (_healthAsShield)
|
|||
|
{
|
|||
|
m_TargetHPText.text = string.Format("{0}/{1}", Utils.ConvertLargeNumToString(targetObj.shieldData.health), Utils.ConvertLargeNumToString(targetObj.shieldData.maxHealth));
|
|||
|
_HPSlider.value = (float)targetObj.shieldData.health / targetObj.shieldData.maxHealth;
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
public void RemoveShield(object obj)
|
|||
|
{
|
|||
|
Obj_NPC targetObj = obj as Obj_NPC;
|
|||
|
if (targetObj == null || targetObj.ServerID != m_TargetServerID || targetObj.shieldData == null)
|
|||
|
return;
|
|||
|
if (_healthAsShield)
|
|||
|
{
|
|||
|
_healthAsShield = false;
|
|||
|
_healthBar.enabled = true;
|
|||
|
_shieldBar.enabled = false;
|
|||
|
}
|
|||
|
|
|||
|
SetTargetName(targetObj);
|
|||
|
ChangeHP(targetObj);
|
|||
|
}
|
|||
|
#endregion
|
|||
|
}
|