Пример #1
0
    public UIUser(Transform _trans, int _type)
    {
        trans = _trans;
        obj   = _trans.gameObject;

        handsRoot  = trans.Find("handsPoker");
        lastRoot   = trans.Find("lastPoker");
        posType    = (PokerPosType)_type;
        handsPoker = new PokerListManage(handsRoot, posType);
        lastPoker  = new PokerListManage(lastRoot, posType);
        info       = new UIUserInfo(trans.Find("info"));
        time       = trans.Find("time");
        txt_time   = time.Find("Text").GetComponent <Text> ();
        time.gameObject.SetActive(false);
        txt_time.text = "";
    }
Пример #2
0
    /// <summary>
    /// 发牌协程
    /// </summary>
    public IEnumerator DealPoker(int[] pokerData)
    {
        int playerIndex = 0;

        for (int i = 0; i < pokerData.Length - 3; i++)
        {
            PokerInfo info = new PokerInfo();
            info.Id = pokerData[i] + 1;
            PokerListManage list = userList[playerIndex].handsPoker;
            Tools.isAnimaOk = false;
            list.SetInfo(info);
            list.Sort();
            list.MovePos();
            playerIndex = (++playerIndex) % 3;
            yield return(new WaitForSeconds(0.1f));
        }

        userList[0].handsPoker.SetClickEvent(true);

        for (int i = pokerData.Length - 3; i < pokerData.Length; i++)
        {
            Poker poker = new Poker(UIGameMainPanel.Self.lastPokerRoot);
            UIGameMainPanel.Self.lastPoker.Add(poker);
        }
        UIGameOperPanel.Self.ShowOperBtn();

        // yield return new WaitForSeconds(1f);
        // //初始化显示底牌
        // InsShowBackPoker();
        // //显示玩家手牌
        // for (int i = 0; i < player.Length; i++)
        // {
        //     player[i].PokerSort();
        //     player[i].ShowPoker();
        // }
        // //发牌完毕为抢地主状态
        // if (state == GameState.Empty)
        // {
        // gameState = GameState.GrabLandLording;
        // }
        // //抢地主按钮
        // if (maxPlayerIndex == -1)
        // {
        //     View_GrabLandLord.SetActive(true);
        // }
    }