Esempio n. 1
0
    /// <summary>
    /// 翻牌
    /// </summary>
    /// <param name="cards"></param>
    public void TurnCards(List <string> cards)
    {
        showCard = true;
        if (cards.Count == 5)
        {
            mHandCard = cards;
        }
        List <Transform> list = mHandCardGid.GetChildList();

        for (int i = 0; i < list.Count; i++)
        {
            TenHandCard handCard = list[i].GetComponent <TenHandCard>();
            if (handCard != null)
            {
                handCard.SetCard(cards[i]);
                if (mHandCardGid.cellWidth > 0)
                {
                    handCard.SetCardDeepsByIndex(i);
                }
                else
                {
                    handCard.SetCardDeepsByIndex(list.Count - i);
                }
                handCard.TurnCard(0.3f, true);
            }
        }
    }
Esempio n. 2
0
    /// <summary>
    /// 直接添加一张手牌
    /// </summary>
    /// <param name="value"></param>
    /// <param name="show"></param>
    private void DirectAddOneHandCard(int seatId, int index, string value, bool show = false)
    {
        GameObject  obj  = obj = NGUITools.AddChild(mHandCardGid.gameObject, mHandCardItem);
        TenHandCard card = obj.GetComponent <TenHandCard>();

        obj.gameObject.SetActive(true);

        if (seatId == TenModel.Inst.mMySeatId)
        {
            obj.transform.localScale = new Vector3(2f, 2f, 2f);
        }

        if (value != "0" && !string.IsNullOrEmpty(value))
        {
            card.SetCard(value);
        }

        if (show)
        {
            card.ShowCardNum(value);
        }
        else
        {
            card.ShowCardBg();
        }
        mHandCard.Add(value);

        mHandCardGid.Reposition();
    }