Files
JJBB/Assets/Project/Script/GUI/Guanning/GuanningPointItem.cs

81 lines
2.2 KiB
C#
Raw Permalink Normal View History

2024-08-23 15:49:34 +08:00

using UnityEngine;
using UnityEngine.UI;
using System.Collections;
using System.Collections.Generic;
using GCGame.Table;
using Games.Mission;
using Games.Events;
using Games.Item;
using GCGame;
using Games.GlobeDefine;
public class GuanningPointItem : UIItemBase
{
public Image _ProIcon;
public Text _Name;
public Text _BattlePoint;
public Text _OtherPoint;
public Text _TotalPoint;
public Image _BGLeft;
public Image _SelfBGLeft;
public Image _BGRight;
public Image _SelfBGRight;
#region
UserSettlement _UserPonintInfo;
public override void Show(Hashtable hash)
{
base.Show(hash);
_UserPonintInfo = (UserSettlement)hash["InitObj"];
InitPlayerPoint(hash);
}
private void InitPlayerPoint(Hashtable hash)
{
//Utils.GetProfessionIconName();
LoadAssetBundle.Instance.SetImageSprite(_ProIcon, Utils.GetProfessionIconName((CharacterDefine.PROFESSION)_UserPonintInfo.Profession));
_Name.text = _UserPonintInfo.UserName;
_BattlePoint.text = _UserPonintInfo.CombatScore.ToString();
_OtherPoint.text = _UserPonintInfo.OtherScore.ToString();
_TotalPoint.text = _UserPonintInfo.TotalScore.ToString();
GameObject selfBG = _SelfBGLeft.gameObject;
_SelfBGLeft.gameObject.SetActive(false);
_SelfBGRight.gameObject.SetActive(false);
if (hash.ContainsKey("SettlementNum"))
{
int settlementNum = (int)hash["SettlementNum"];
if (settlementNum == 0)
{
_BGLeft.gameObject.SetActive(true);
_BGRight.gameObject.SetActive(false);
selfBG = _SelfBGLeft.gameObject;
}
else
{
_BGLeft.gameObject.SetActive(false);
_BGRight.gameObject.SetActive(true);
selfBG = _SelfBGRight.gameObject;
}
}
if (_UserPonintInfo.UserName == GameManager.gameManager.PlayerDataPool.MainPlayerBaseAttr.RoleName)
{
selfBG.gameObject.SetActive(true);
}
else
{
selfBG.gameObject.SetActive(false);
}
}
#endregion
}