Ejemplo n.º 1
0
        /// <summary>
        /// 房间开局通知
        /// </summary>
        /// <param name="betGold">减的底注数量</param>
        /// <param name="roomAllGold">房间当前所有金币</param>
        /// <param name="nextOperationUid">下一操作得到玩家uid</param>
        /// <param name="dtoList">减底注之后各个玩家剩余金币</param>
        public override void battle(int betGold, long roomAllGold, long nextOperationUid, Game1BettleWeatnUpdateListDto dtoList)
        {
            PlayerCache.roomTurnPlayer = new RoomTurnPlayer(PlayerCache.playGamePlayer);

            UIZJHPanel zjhpanel = MessageManager.GetInstance.GetUIDict <UIZJHPanel>();

            if (zjhpanel == null)
            {
                zjhpanel = MessageManager.GetInstance.GetUIDict <CheatZjhPanel>();
            }
            zjhpanel.HidePrepare();
            zjhpanel.StartGame();
            PlayerCache.currentRoomState = 2;
            AudioManager.Instance.PlaySound("nvfapai");
            if (!zjhpanel.IsPrepare)
            {
                zjhpanel.WaitPrepare();
            }

            for (int i = 0; i < dtoList.updateList.Count; i++)
            {
                PlayerCache.roomPlayerObjDic[dtoList.updateList[i].uid].PlayerBet(betGold);
                PlayerCache.roomPlayerObjDic[dtoList.updateList[i].uid].StartGame();
                PlayerCache.roomPlayerObjDic[dtoList.updateList[i].uid].UpdatePlayerGold(dtoList.updateList[i].holdGold);
            }

            PlayerCache.firstBetPlayer = nextOperationUid;
            DebugUtils.DebugerExtension.Log("开始游戏,开下注玩家" + PlayerCache.roomPlayersInfoDic[nextOperationUid].userName + "位置:" + PlayerCache.roomPlayersInfoDic[nextOperationUid].postion);
            //设置开始该玩家为开始下注玩家
            PlayerCache.CurrentTurnPlayerUid = nextOperationUid;
            if (nextOperationUid == PlayerCache.loginInfo.uid)
            {
                PlayerCache.roomPlayerObjDic[nextOperationUid].TurnSelf();
            }
            else
            {
                zjhpanel.HideBetButton();
            }
            PlayerCache.roomPlayerObjDic[nextOperationUid].PlayeProgressAni();
        }
Ejemplo n.º 2
0
    /// <summary>
    /// 播放PK动画
    /// </summary>
    public IEnumerator PlayPkAni(GamePlayer otherPlayer, GamePlayer loser)
    {
        StartPK();

        otherPlayer.StartPK();
        Transform pkPanelTrans = transform.parent.parent.Find("PkPanel");

        pkPanelTrans.GetChild(2).gameObject.SetActive(false);

        pkPanelTrans.gameObject.SetActive(true);
        //blue
        AudioManager.Instance.PlaySound("s_bipai");
        pkPanelTrans.GetChild(0).localPosition = new Vector3(-890, 40, 0);
        pkPanelTrans.GetChild(0).DOLocalMove(new Vector3(-250, 40, 0), 0.5f);
        //red
        pkPanelTrans.GetChild(1).localPosition = new Vector3(890, 42, 0);
        pkPanelTrans.GetChild(1).DOLocalMove(new Vector3(170, 42, 0), 0.5f);
        if (isInitiativeCompare)
        {
            transform.GetChild(2).DOLocalMove(GetLeftPk(), 0.5f);
            otherPlayer.transform.GetChild(2).DOLocalMove(otherPlayer.GetRightPk(), 0.5f);
        }
        else
        {
            transform.GetChild(2).DOLocalMove(GetRightPk(), 0.5f);
            otherPlayer.transform.GetChild(2).DOLocalMove(otherPlayer.GetLeftPk(), 0.5f);
        }
        yield return(new WaitForSeconds(0.5f));

        //pk字
        pkPanelTrans.GetChild(2).gameObject.SetActive(true);
        yield return(new WaitForSeconds(0.5f));

        loser.ShowBoom();
        yield return(new WaitForSeconds(1f));

        loser.transform.GetChild(2).Find("boom").gameObject.SetActive(false);
        pkPanelTrans.gameObject.SetActive(false);
        transform.GetChild(2).DOLocalMove(Vector3.zero, 0.5f);
        otherPlayer.transform.GetChild(2).DOLocalMove(Vector3.zero, 0.5f);
        if (player != null)
        {
            if (player.uid == PlayerCache.loginInfo.uid && loser.player.uid != PlayerCache.loginInfo.uid)
            {
                AudioManager.Instance.PlaySound("s_bipaiSuccess");
                zjhPanel.HideBetButton();
            }
            else if (player.uid == PlayerCache.loginInfo.uid && loser.player.uid == PlayerCache.loginInfo.uid)
            {
                AudioManager.Instance.PlaySound("s_bipaiFailed");
                zjhPanel.WaitPrepare();
            }

            EndPK();
            otherPlayer.EndPK();
            if (loser.player.uid == PlayerCache.loginInfo.uid)
            {
                loser.HideLook();
            }
        }
    }