コード例 #1
0
 public LTPVPTeamHud(Transform transform, bool isSelfTeam)
 {
     m_IsSelfTeam = isSelfTeam;
     m_TeamCard   = new LTPVPTeamCardInfo[6];
     for (int i = 0; i < m_TeamCard.Length; i++)
     {
         m_TeamCard[i] = new LTPVPTeamCardInfo(transform.Find("Content/Grid/Item_" + i), OnClickPartnerItem);
     }
     m_SetTotal = 0;
 }
コード例 #2
0
        /// <summary>
        /// 点击阵型里的伙伴
        /// </summary>
        /// <param name="cardItem">点击的卡片item</param>
        private void OnClickPartnerItem(LTPVPTeamCardInfo cardItem)
        {
            HeroBattleChoiceCellData partnerData = cardItem.F_GetCurrentPartnerData();

            if (LTHeroBattleModel.GetInstance().choiceData.choiceState == 0 &&
                LTHeroBattleModel.GetInstance().choiceData.openUid == LTHeroBattleModel.GetInstance().choiceData.selfInfo.uid &&
                !m_IsSelfTeam &&
                partnerData != null)
            {
                //通知选中的人
                FusionAudio.PostEvent("UI/General/ButtonClick", true);
                LTHeroBattleEvent.ChoiceHero(partnerData.heroTplID);
                //
                for (int i = 0; i < m_TeamCard.Length; i++)
                {
                    m_TeamCard[i].F_SetLockState(m_TeamCard[i] == cardItem);
                }
            }
        }