void Start()
 {
     tip = Instantiate(m_Tip);
     tip.SetActive(false);
     if (_handCardMgr == null)
     {
         _handCardMgr = GetComponentInChildren <DHM_HandCardManager>();
     }
     if (_recyleCardMgr == null)
     {
         _recyleCardMgr = GetComponentInChildren <DHM_RecyleHandCardManager>();
     }
     if (_pengGangMgr == null)
     {
         _pengGangMgr = GetComponentInChildren <PengGangManager>();
     }
     if (_handAnimationCtr == null)
     {
         _handAnimationCtr = GetComponentInChildren <DHM_HandAnimationCtr>();
     }
     if (_handCardMgr != null && _recyleCardMgr != null)
     {
         _handCardMgr.chuPaiEvent           += _recyleCardMgr.ChuPai;
         _recyleCardMgr.ChuPaiCallBackEvent += _handCardMgr.ChuPaiCallBackEventHandle;
     }
     //initHighLight();
 }
Exemplo n.º 2
0
    void lockHandCards()
    {
        Debug.Log("lock");
        DHM_HandCardManager hcm  = getHandCardManager();
        List <HandCardItem> list = new List <HandCardItem>(hcm._handCardList);

        if (hcm._MoHand != null)
        {
            list.Add(hcm._MoHand);
        }

        foreach (HandCardItem item in list)
        {
            item.setInteractable(false, false);
        }
    }
Exemplo n.º 3
0
    public void checkTingPai()
    {
        Debug.Log("checkTingPai");

        List <int>          tingouts = _options.tingouts;
        DHM_HandCardManager hcm      = getHandCardManager();
        List <HandCardItem> list     = new List <HandCardItem>(hcm._handCardList);

        if (hcm._MoHand != null)
        {
            list.Add(hcm._MoHand);
        }

        for (int i = 0; i < list.Count; i++)
        {
            HandCardItem item  = list [i];
            bool         check = tingouts == null || tingouts.Contains(item.getId());
            item.setInteractable(check);
        }
    }
Exemplo n.º 4
0
    void Start()
    {
        switch (m_Player)
        {
        case DHM_HandCardManager.PlayerType.East:
            localindex = 0;
            break;

        case DHM_HandCardManager.PlayerType.South:
            localindex = 1;
            break;

        case DHM_HandCardManager.PlayerType.West:
            localindex = 2;
            break;

        case DHM_HandCardManager.PlayerType.North:
            localindex = 3;
            break;
        }

        seatindex = RoomMgr.GetInstance().getSeatIndexByLocal(localindex);

        _handCardMgr      = GetComponentInChildren <DHM_HandCardManager>();
        _recyleCardMgr    = GetComponentInChildren <DHM_RecyleHandCardManager>();
        _pengGangMgr      = GetComponentInChildren <PengGangManager>();
        _handAnimationCtr = GetComponentInChildren <DHM_HandAnimationCtr>();

        _handCardMgr.seatindex   = seatindex;
        _recyleCardMgr.seatindex = seatindex;
        _pengGangMgr.seatindex   = seatindex;

        _handCardMgr.chuPaiEvent           += _recyleCardMgr.ChuPai;
        _recyleCardMgr.ChuPaiCallBackEvent += _handCardMgr.ChuPaiCallBackEventHandle;

        if (RoomMgr.GetInstance().seatindex == seatindex)
        {
            SetLayer();
        }
    }
Exemplo n.º 5
0
    public void checkChuPai(bool check)
    {
        Debug.Log("checkChuPai: " + check.ToString());

        DHM_HandCardManager hcm  = getHandCardManager();
        List <HandCardItem> list = new List <HandCardItem>(hcm._handCardList);

        if (hcm._MoHand != null)
        {
            list.Add(hcm._MoHand);
        }

        SeatInfo seat = RoomMgr.GetInstance().getSelfSeat();
        bool     show = check && !seat.tingpai;

        GameAction ac = _options;

        List <int> tingouts = new List <int>();

        if (_tingState == 0 && ac != null)
        {
            for (int i = 0; i < ac.help.Count; i++)
            {
                tingouts.Add(ac.help[i].pai);
            }
        }

        foreach (HandCardItem item in list)
        {
            int  id     = item.getId();
            bool active = show && !seat.limit.Contains(id);
            item.setInteractable(active);

            if (active && tingouts.Contains(id))
            {
                item.getObj().GetComponent <HandCard> ().choosed();
            }
        }
    }