Beispiel #1
0
    /// <summary>
    /// 游戏开始
    /// </summary>
    /// <param name="seatId"></param>
    public void NetOnGameStart(int seatId)
    {
        CleanDesk();
        List <int> list = new List <int>();

        list.AddRange(mPlayerDic.Keys);

        for (int i = 0; i < list.Count; i++)
        {
            mPlayerDic[list[i]].SetZhuangState(false);
            mPlayerDic[list[i]].SetReadyState(false);
        }

        TenPlayerUI player = null;

        if (TryGetPlayer(seatId, out player))
        {
            player.SetZhuangState(true);
        }

        mSelfPlayer.SetReadybtnState(false);
        mSelfPlayer.SetInvateBtnState(false);
        mSelfPlayer.SetChangDeskBtnState(false);
        //
        mSelfPlayer.HidePlayerPoint();
    }
Beispiel #2
0
    /// <summary>
    /// 随机选庄
    /// </summary>
    /// <param name="seatId"></param>
    private IEnumerator StartRandomZhuang(int seatId, List <int> list)
    {
        mRandomZhuangDown = false;
        TenPlayerUI player = null;

        for (int k = 0; k < 4; k++)
        {
            for (int i = 0; i < list.Count; i++)
            {
                if (TryGetPlayer(list[i], out player))
                {
                    player.SetRandomZhuangAnimState(true);
                    yield return(new WaitForSeconds(0.15f));

                    player.SetRandomZhuangAnimState(false);
                }
            }
        }

        for (int i = 0; i < TenModel.Inst.mSeatList.Count; i++)
        {
            if (TryGetPlayer(TenModel.Inst.mSeatList[i], out player))
            {
                player.SetZhuangState(false);
                if (TenModel.Inst.mSeatList[i] != seatId)
                {
                    player.SetQiangZhuangResult(false, 0);
                }
            }
        }

        for (int i = 0; i < TenModel.Inst.mGameedSeatIdList.Count; i++)
        {
            if (TryGetPlayer(TenModel.Inst.mGameedSeatIdList[i], out player))
            {
                player.SetRandomZhuangAnimState(false);
            }
        }

        if (TryGetPlayer(seatId, out player))
        {
            mFlyZhuang.gameObject.SetActive(true);
            mFlyZhuang.gameObject.transform.position = mFlyZhuangPosition;
            Hashtable     args       = new Hashtable();
            List <object> finishargs = new List <object>();
            args.Add("easeType", iTween.EaseType.linear);
            args.Add("time", 0.4f);
            args.Add("oncomplete", "OnRandomZhuangFlyFinish");
            args.Add("oncompleteparams", seatId);
            args.Add("oncompletetarget", gameObject);
            args.Add("position", player.GetZhuangPosition());
            iTween.MoveTo(mFlyZhuang, args);
        }
        yield return(new WaitForSeconds(0.4f));

        mRandomZhuangDown = true;

        //开始声音
        SoundProcess.PlaySound("Ten/SDB_wrnn_start");
    }
Beispiel #3
0
    /// <summary>
    /// 随机庄移动结束
    /// </summary>
    /// <param name="seatId"></param>
    private void OnRandomZhuangFlyFinish(int seatId)
    {
        mFlyZhuang.gameObject.SetActive(false);
        TenPlayerUI player = null;

        if (TryGetPlayer(seatId, out player))
        {
            player.SetZhuangState(true);
        }
    }
Beispiel #4
0
 /// <summary>
 /// 换庄
 /// </summary>
 /// <param name="seatId"></param>
 private void ChangZhuang(int seatId)
 {
     for (int i = 0; i < TenModel.Inst.mSeatList.Count; i++)
     {
         TenPlayerUI player = null;
         if (TryGetPlayer(TenModel.Inst.mSeatList[i], out player))
         {
             player.SetZhuangState(false);
             if (TenModel.Inst.mSeatList[i] == seatId)
             {
                 player.SetZhuangState(true);
             }
             else
             {
                 player.SetQiangZhuangResult(false, 0);
             }
         }
     }
 }