コード例 #1
0
 /// <summary>
 /// 显示卡组
 /// </summary>
 /// <param name="cardGroup"></param>
 private void Show(Group cardGroup)
 {
     for (int i = 0; i < cardGroup.GroupNum; i++)
     {
         Card_Select card_select = cardList[i];
         Card        card        = cardGroup.GetCard(i);
         card_select.SetActive(true);
         card_select.SetText(card.curArea, card.areaRank);
         card_select.SetTexture(card.cardID, false);
     }
     for (int i = cardGroup.GroupNum; i < 10; i++)
     {
         Card_Select card_select = cardList[i];
         card_select.SetActive(false);
     }
     for (int i = (curPage - 1) * 10; i < curPage * 10; i++)
     {
         if (i >= choseList.Count)
         {
             break;
         }
         if (choseList[i])
         {
             cardList[i % 10].SetSelect();
         }
         else
         {
             cardList[i % 10].SetDisSelect();
         }
     }
     UpdateText();
 }
コード例 #2
0
    void card_select_event_disSelectCard(int num, Card_Select obj)
    {
        if (CanNotControl())
        {
            return;
        }
        obj.SetDisSelect();
        int i = (curPage - 1) * 10 + num;

        choseList[i] = false;
        curSelectNum--;

        if (IsSendMes())
        {
            DuelEventSys.GetInstance.SendEvent(DuelEvent.netEvent_SendSelectCardGroup, false, i);
        }
    }
コード例 #3
0
 private void InitCardGroup()
 {
     curShowGroup = new Group();
     for (int i = 0; i < 10; i++)
     {
         GameObject card = GameObject.Instantiate(cardPrefeb);
         card.transform.SetParent(layoutGroup.transform);
         card.transform.localScale = Vector3.one;
         card.GetComponent <RectTransform>().anchoredPosition3D = Vector3.zero;
         Card_Select card_select = card.GetComponent <Card_Select>();
         card_select.Init(i);
         cardList.Add(card_select);
         card_select.SetActive(false);
         card_select.event_disSelectCard += card_select_event_disSelectCard;
         card_select.event_selectCard    += card_select_event_selectCard;
     }
 }
コード例 #4
0
    void card_select_event_selectCard(int num, Card_Select obj)
    {
        if (curMaxSelectNum != -1 && curSelectNum == curMaxSelectNum)
        {
            return;
        }
        if (CanNotControl())
        {
            return;
        }
        obj.SetSelect();
        int i = (curPage - 1) * 10 + num;

        choseList[i] = true;
        curSelectNum++;


        if (IsSendMes())
        {
            DuelEventSys.GetInstance.SendEvent(DuelEvent.netEvent_SendSelectCardGroup, true, i);
        }
    }