コード例 #1
0
ファイル: ZhiboGameMode.cs プロジェクト: DLBL0624/CSCI529
    private void LoadCard()
    {
        List <CardInfo> infoList = mCardMdl.GetAllCards();

        state.CardDeck.Clear();
        foreach (CardInfo info in infoList)
        {
            string      eid  = info.CardId;
            CardAsset   ca   = mCardMdl.GetCardInfo(eid);
            CardInZhibo card = new CardInZhibo(eid, ca.UseTime);
            card.ca = ca;
            state.CardDeck.Add(card);
        }

        List <string> platformCards = pRoleMgr.GetNowPlatformInfo().PlatformCards;

        for (int i = 0; i < platformCards.Count; i++)
        {
            string      eid  = platformCards[i];
            CardAsset   ca   = mCardMdl.GetCardInfo(eid);
            CardInZhibo card = new CardInZhibo(eid, ca.UseTime);
            card.ca = ca;
            state.CardDeck.Add(card);
        }

        shuffle <CardInZhibo>(state.CardDeck);
    }
コード例 #2
0
    private void ShowCards()
    {
        List <CardInfo> infos = pCardMgr.GetAllCards();


        foreach (CardOutView vv in view.CardsViewList)
        {
            pResLoader.ReleaseGO("UI/Card", vv.root.gameObject);
        }
        view.CardsViewList.Clear();
        preCardView        = null;
        model.NowCardInfos = infos;
        foreach (CardInfo c in infos)
        {
            GameObject  go          = pResLoader.Instantiate("UI/Card", view.CardsContainer);
            CardOutView cardOutView = new CardOutView();
            cardOutView.BindView(go.transform);
            view.CardsViewList.Add(cardOutView);
            cardOutView.Hint.gameObject.SetActive(false);

            {
                ClickEventListerner listener = cardOutView.CardFace.gameObject.GetComponent <ClickEventListerner>();
                if (listener == null)
                {
                    listener = cardOutView.CardFace.gameObject.AddComponent <ClickEventListerner>();
                }

                listener.ClearClickEvent();
                listener.OnClickEvent += delegate {
                    ShowCardDetail(cardOutView);
                };
            }

            CardAsset ca = pCardMgr.GetCardInfo(c.CardId);
            cardOutView.Name.text = ca.CardName;
            cardOutView.Desp.text = ca.CardEffectDesp;
        }
    }
コード例 #3
0
    private void ShowCardsAll()
    {
        List <CardInfo> infos = pCardMgr.GetAllCards();

        UpdateCards(infos);
    }