150 lines
4.6 KiB
C#
150 lines
4.6 KiB
C#
|
using Games.ChatHistory;
|
|||
|
using Games.GlobeDefine;
|
|||
|
using Games.LogicObj;
|
|||
|
using GCGame;
|
|||
|
using GCGame.Table;
|
|||
|
using UnityEngine;
|
|||
|
using UnityEngine.UI;
|
|||
|
|
|||
|
public class PlayerHeadInfo : MonoBehaviour {
|
|||
|
|
|||
|
public Text m_LabelTitleBoard;
|
|||
|
public Image m_SprVip;
|
|||
|
public Text m_LabelName;
|
|||
|
public Image m_SprPaoShang;
|
|||
|
public Image m_SprCanKill;
|
|||
|
public Image m_SprKillMe;
|
|||
|
public GameObject m_ObjChatBubble;
|
|||
|
public GameObject m_ObjOriginalHeadInfo;
|
|||
|
public ChatBubbleLogic m_ChatBubbleLogic;
|
|||
|
|
|||
|
public void UpdateOtherPkModel(Obj_OtherPlayer obj)
|
|||
|
{
|
|||
|
Tab_SceneClass sceneInfo = TableManager.GetSceneClassByID(GameManager.gameManager.RunningScene, 0);
|
|||
|
if (sceneInfo == null)
|
|||
|
return;
|
|||
|
Tab_PVPRule pvpRule = TableManager.GetPVPRuleByID(sceneInfo.PVPRule, 0);
|
|||
|
if (pvpRule == null)
|
|||
|
return;
|
|||
|
if(Singleton<ObjManager>.Instance.MainPlayer!=null)
|
|||
|
{
|
|||
|
if(Singleton<ObjManager>.Instance.MainPlayer.BaseAttr.Level<=pvpRule.ProtectLevel)
|
|||
|
{
|
|||
|
return;
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
m_SprCanKill.gameObject.SetActive(false);
|
|||
|
m_SprKillMe.gameObject.SetActive(false);
|
|||
|
if (Reputation.IsCanPk(obj))
|
|||
|
m_SprCanKill.gameObject.SetActive(true);
|
|||
|
if (Reputation.IsCanBeAttack(obj))
|
|||
|
m_SprKillMe.gameObject.SetActive(true);
|
|||
|
}
|
|||
|
|
|||
|
public void UpdateVipInfo(int nVipCost)
|
|||
|
{
|
|||
|
if (m_SprVip != null && m_LabelName != null)
|
|||
|
{
|
|||
|
if (nVipCost > 0)
|
|||
|
{
|
|||
|
m_SprVip.gameObject.SetActive(true);
|
|||
|
|
|||
|
float fShifty = m_SprVip.transform.localPosition.y;
|
|||
|
|
|||
|
LoadAssetBundle.Instance.SetImageSprite(m_SprVip, VipData.GetVipImage(nVipCost));
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
m_SprVip.gameObject.SetActive(false);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
public void UpdatePaoShangIcon(int nIconState)
|
|||
|
{
|
|||
|
switch (nIconState)
|
|||
|
{
|
|||
|
case (int)GC_BROADCASTPSSTATE.PSSTATE.REMOVE:
|
|||
|
m_SprPaoShang.gameObject.SetActive(false);
|
|||
|
break;
|
|||
|
case (int)GC_BROADCASTPSSTATE.PSSTATE.CANROB:
|
|||
|
m_SprPaoShang.gameObject.SetActive(true);
|
|||
|
LoadAssetBundle.Instance.SetImageSprite(m_SprPaoShang, "ShangNon");
|
|||
|
break;
|
|||
|
case (int)GC_BROADCASTPSSTATE.PSSTATE.NOTCANROB:
|
|||
|
m_SprPaoShang.gameObject.SetActive(true);
|
|||
|
LoadAssetBundle.Instance.SetImageSprite(m_SprPaoShang, "ShangOk");
|
|||
|
break;
|
|||
|
default:
|
|||
|
m_SprPaoShang.gameObject.SetActive(false);
|
|||
|
break;
|
|||
|
}
|
|||
|
}
|
|||
|
public void ShowTitleInvestitiveByTable(int titleID, string strTitleInvestitive)
|
|||
|
{
|
|||
|
if (null != m_LabelTitleBoard)
|
|||
|
{
|
|||
|
Tab_TitleData tabTitle = TableManager.GetTitleDataByID(titleID, 0);
|
|||
|
if (tabTitle != null)
|
|||
|
{
|
|||
|
string strTitle = "";
|
|||
|
strTitle = string.Format("<color=#{0}>{1}</color>", tabTitle.ColorLevel, strTitleInvestitive);
|
|||
|
m_LabelTitleBoard.text = strTitle;
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
m_LabelTitleBoard.text = "";
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
if (GameManager.gameManager.RunningScene == (int)GameDefine_Globe.SCENE_DEFINE.SCENE_GUANNING)
|
|||
|
{
|
|||
|
m_LabelTitleBoard.text = "";
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
public void ShowTitleInvestitive(string strTitleInvestitive)
|
|||
|
{
|
|||
|
int titleId = GameManager.gameManager.PlayerDataPool.TitleInvestitive.GetCurrentTitleID();
|
|||
|
if (titleId != -1)
|
|||
|
{
|
|||
|
Tab_TitleData tabTitle = TableManager.GetTitleDataByID(titleId, 0);
|
|||
|
if(tabTitle != null)
|
|||
|
{
|
|||
|
string strTitle = "";
|
|||
|
strTitle = string.Format("<color=#{0}>{1}</color>", tabTitle.ColorLevel, strTitleInvestitive);
|
|||
|
m_LabelTitleBoard.text = strTitle;
|
|||
|
}else
|
|||
|
{
|
|||
|
m_LabelTitleBoard.text = strTitleInvestitive;
|
|||
|
}
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
m_LabelTitleBoard.text = strTitleInvestitive;
|
|||
|
}
|
|||
|
|
|||
|
if (GameManager.gameManager.RunningScene == (int)GameDefine_Globe.SCENE_DEFINE.SCENE_GUANNING)
|
|||
|
{
|
|||
|
m_LabelTitleBoard.text = "";
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
public void ShowOriginalHeadInfo(bool bShow)
|
|||
|
{
|
|||
|
if(null != m_ObjOriginalHeadInfo)
|
|||
|
{
|
|||
|
m_ObjOriginalHeadInfo.SetActive(bShow);
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
public void ShowChatBubble(ChatHistoryItem text)
|
|||
|
{
|
|||
|
if (null != m_ChatBubbleLogic)
|
|||
|
{
|
|||
|
m_ChatBubbleLogic.Show(text);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|