Esempio n. 1
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);
        }
    }
Esempio n. 2
0
    public IEnumerator _Fapai()
    {
        AudioManager am = AudioManager.GetInstance();
        RoomMgr      rm = RoomMgr.GetInstance();

        ResetCards();

        SeatInfo seat  = rm.seats[seatindex];
        bool     valid = seat.isHoldsValid();

        List <int> holds = new List <int>(seat.holds);
        int        cnt   = seat.getHoldsLen();
        int        mopai = 0;

        if (!valid)
        {
            for (int i = 0; i < cnt; i++)
            {
                holds.Add(INVALID_ID);
            }
        }

        if (cnt % 3 == 2)
        {
            mopai = holds[cnt - 1];
            holds.RemoveAt(cnt - 1);
        }

        bool replay = ReplayMgr.GetInstance().isReplay();

        if (!isMyself() && replay)
        {
            _HandCardPlace.transform.Translate(0, 0, 0.04f);
            _HandCardPlace.transform.Rotate(-90, 0, 0);

            _MoHandPos.transform.Rotate(-90, 0, 0);
        }

        holds.Sort((a, b) => a - b);
        idArray = holds;

        for (int i = 0; i < holds.Count; i++)
        {
            int        id  = holds[i];
            float      x   = holds.Count / 2.0f - i;
            GameObject obj = ResourcesMgr.GetInstance().LoadMJ(id);
            Transform  tm  = obj.transform;

            obj.layer          = m_handCard_layer;
            obj.gameObject.tag = tagValue;
            tm.SetParent(_HandCardPlace);

            HandCardItem item = new HandCardItem(id, obj);

            item.setInteractable(false, false);
            _handCardList.Add(item);

            tm.localPosition = Vector3.zero;
            tm.localRotation = Quaternion.Euler(Vector3.zero);
            tm.Translate(offSetX * x, 0, 0);

            am.PlayEffectAudio("dice");

            yield return(new WaitForSeconds(0.05f));
        }

        _MoHandPos.localPosition = !isMyself() && replay ? new Vector3(0, 0, 0.04f) : Vector3.zero;
        _MoHandPos.Translate(-(holds.Count / 2.0f + 0.5f) * offSetX, 0, 0);

        if (mopai > 0)
        {
            SetMoHandCard(mopai);
            _MoHand.setInteractable(false, false);
        }

        Dance();
    }