Example #1
0
        public void SetUI(DataTransfer data)
        {
            //拥有的英雄
            List <int> jobList = data.GetData <List <int> >(ConstDefine.Has_Job);
            //当前的英雄
            int curJob = data.GetData <int>(ConstDefine.Cur_Job);
            //拥有的金币
            int coin = data.GetData <int>(ConstDefine.Has_Coin);

            for (int i = 0; i < jobList.Count; i++)
            {
                for (int j = 0; j < m_JobList.Count; j++)
                {
                    if (jobList[i] == m_JobList[i].Index)
                    {
                        m_JobList[i].HasJob();
                    }
                }
            }
            for (int i = 0; i < m_JobList.Count; i++)
            {
                if (m_JobList[i].Index == curJob)
                {
                    m_JobItem = m_JobList[i];
                    m_JobList[i].IsCurJob();
                }
            }
            m_Coin.text = coin.ToString();
        }
Example #2
0
 private void OnClickJonItem(UIJobItemView jobItem)
 {
     if (m_JobItem != null)
     {
         m_JobItem.OnChange();
     }
     m_JobItem = jobItem;
 }