コード例 #1
0
    public void OnClickBtn(GameObject obj)
    {
        string name = obj.name;;

        switch (int.Parse(name.Split('_')[1]))
        {
        case 1:
            CurFixedcolorType = eFixedType.WAN;
            break;

        case 2:
            CurFixedcolorType = eFixedType.TIAO;
            break;

        case 3:
            CurFixedcolorType = eFixedType.TONG;
            break;
        }
        for (int i = 0; i < mToggleList.Count; i++)
        {
            if (obj.name == mToggleList[i].name)
            {
                mCircle[i].SetActive(true);
            }
            else
            {
                mCircle[i].SetActive(false);
            }
        }
        OptRequest req = new OptRequest();

        req.ins  = eMJInstructionsType.FIXEDCOLOR;
        req.type = (int)CurFixedcolorType;
        Global.Inst.GetController <MJGameController>().SendOptRequest(req, () => { button.gameObject.SetActive(false); });
    }
コード例 #2
0
    /// <summary>
    /// 定缺显示
    /// </summary>
    public void UpdataFixe(eFixedType type, bool isMy = false, bool isAnim = false)
    {
        if (type == eFixedType.NONE)
        {
            SetDingqueShow(false);
            return;
        }
        string str = "";

        switch (type)
        {
        case eFixedType.WAN:
            str = "万";
            if (isMy)
            {
                MJGameModel.Inst.eFixe = new int[] { 20, 30 }
            }
            ;
            break;

        case eFixedType.TIAO:
            str = "条";
            if (isMy)
            {
                MJGameModel.Inst.eFixe = new int[] { 0, 10 }
            }
            ;
            break;

        case eFixedType.TONG:
            str = "筒";
            if (isMy)
            {
                MJGameModel.Inst.eFixe = new int[] { 10, 20 }
            }
            ;
            break;
        }
        if (isMy)
        {
            MJGameModel.Inst.eFixeType = type;
        }
        if (!isAnim)
        {
            SetDingqueShow(true, str);
        }
        else
        {
            SetDingqueAnim(true, type);
        }
    }
コード例 #3
0
 /// <summary>
 /// 初始化
 /// </summary>
 public void IntoView(eFixedType fixType)
 {
     //button.gameObject.SetActive(true);
     for (int i = 0; i < mToggleList.Count; i++)
     {
         mToggleList[i].gameObject.SetActive(true);
         mCircle[i].SetActive(false);
     }
     CurFixedcolorType = fixType;
     if (CurFixedcolorType == eFixedType.NONE)
     {
         CurFixedcolorType = eFixedType.WAN;
     }
     mCircle[(int)CurFixedcolorType - 1].SetActive(true);
     gameObject.SetActive(true);
     //mGreid.Reposition();
 }
コード例 #4
0
    /// <summary>
    /// 设置定缺类型
    /// </summary>
    /// <param name="_type">定缺类型</param>
    public void SetMyFixedType(int _type)
    {
        eFixeType = (eFixedType)_type;
        switch (_type)
        {
        case (int)eFixedType.WAN:
            eFixe = new int[] { 20, 30 };
            break;

        case (int)eFixedType.TIAO:
            eFixe = new int[] { 0, 10 };
            break;

        case (int)eFixedType.TONG:
            eFixe = new int[] { 10, 20 };
            break;
        }
    }
コード例 #5
0
 private void InitAllFixeType(CardsInfoStruct[] info, eRoomState state)
 {
     if (state == eRoomState.FIXEDCOLOR)
     {
         return;
     }
     foreach (var item in info)
     {
         if (item != null)
         {
             eFixedType _type = (eFixedType)item.fixedType;
             if (_type != eFixedType.NONE && item.isChanged)
             {
                 int index = MJGameModel.Inst.mnewSeatToIndex[item.seatId];
                 mAllPlayer[index].UpdataFixe(_type, item.seatId == MJGameModel.Inst.mMySeatId);
             }
         }
     }
 }
コード例 #6
0
    /// <summary>
    /// 获取定缺区间
    /// </summary>
    /// <param name="_type"></param>
    /// <returns></returns>
    public int[] GetPlayerFixedType(eFixedType _type)
    {
        int[] fdata = null;
        switch (_type)
        {
        case eFixedType.WAN:
            fdata = new int[] { 20, 30 };
            break;

        case eFixedType.TIAO:
            fdata = new int[] { 0, 10 };
            break;

        case eFixedType.TONG:
            fdata = new int[] { 10, 20 };
            break;
        }
        return(fdata);
    }
コード例 #7
0
    /// <summary>
    /// 显示定缺动画
    /// </summary>
    /// <param name="isshow"></param>
    /// <param name="text"></param>
    public void SetDingqueAnim(bool isshow, eFixedType ftype)
    {
        mDingQue.gameObject.SetActive(false);
        mTips.gameObject.SetActive(false);
        mDingqueAnim.gameObject.SetActive(isshow);
        string str = "";

        if (isshow)
        {
            string spname = "";
            switch (ftype)
            {
            case eFixedType.TIAO:
                spname = "tiao_big";
                str    = "条";
                break;

            case eFixedType.TONG:
                spname = "tong_big";
                str    = "筒";
                break;

            case eFixedType.WAN:
                spname = "wan_big";
                str    = "万";
                break;
            }
            mDingqueAnim.transform.position = mDingqueAnimRoot.position;
            mDingqueAnim.GetComponent <UISprite>().spriteName = spname;
            mDingqueAnim.ResetToBeginning();
            mDingqueAnim.PlayForward();
            iTween.MoveTo(mDingqueAnim.gameObject, iTween.Hash("position", mDingQue.transform.position, "time", 0.5f, "islocal", false, "easetype", iTween.EaseType.linear));
            DelayRun(0.51f, () =>
            {
                mDingqueAnim.gameObject.SetActive(false);
                SetDingqueShow(true, str);
            });
        }
    }