55 lines
1.7 KiB
C#
55 lines
1.7 KiB
C#
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
using GCGame.Table;
|
|
|
|
public class CrossServerPostItem : MonoBehaviour
|
|
{
|
|
public Text Exp;
|
|
public Text Scort;
|
|
public Image MoneyIcon;
|
|
public Text Money;
|
|
|
|
public GameObject SelectObj;
|
|
Tab_CrossSerEscortConfig m_config;
|
|
public void SetSelect(bool state)
|
|
{
|
|
SelectObj.SetActive(state);
|
|
}
|
|
|
|
public void Init(Tab_CrossSerEscortConfig config)
|
|
{
|
|
if (config == null)
|
|
return;
|
|
m_config = config;
|
|
Tab_CrossSerEscortAward award = TableManager.GetCrossSerEscortAwardByID(GameManager.gameManager.PlayerDataPool.MainPlayerBaseAttr.Level,0);
|
|
if (award == null)
|
|
return;
|
|
Exp.text = award.GetSuccessExpbyIndex(config.Quality-1).ToString();
|
|
Scort.text = award.GetSuccessReputationbyIndex(config.Quality-1).ToString();
|
|
if(GameManager.gameManager.PlayerDataPool.Money.GetMoneyByType((MONEYTYPE)config.MoneyType) < config.Price)
|
|
{
|
|
Money.text = string.Format("<color=#ff3131ff>{0}</color>", config.Price.ToString());
|
|
}
|
|
else
|
|
{
|
|
Money.text = string.Format("<color=#ffffffff>{0}</color>", config.Price.ToString());
|
|
}
|
|
|
|
LoadAssetBundle.Instance.SetImageSprite(MoneyIcon, UICurrencyItem.GetCurrencySprite((MONEYTYPE)config.MoneyType));
|
|
SelectObj.SetActive(false);
|
|
}
|
|
|
|
public void Click_AcceptMission()
|
|
{
|
|
if(SelectObj.activeSelf && m_config!=null)
|
|
{
|
|
if(JudgeMoneyLogic.IsMoneyEnough((MONEYTYPE)m_config.MoneyType, m_config.Price))
|
|
{
|
|
ReqCrossSerEscort cmd = new ReqCrossSerEscort();
|
|
cmd.GharryDataID = m_config.Id;
|
|
cmd.SendMsg();
|
|
}
|
|
}
|
|
}
|
|
|
|
} |