예제 #1
0
    /// <summary>
    /// 播放发牌动画
    /// </summary>
    private IEnumerator PlaySendCardAnimator()
    {
        //发牌之前先回收之前的牌
        foreach (BattleAreaItem areaItem in View.battleAreaItems)
        {
            areaItem.SaveAllCard();
        }
        View.cardArrowIcon.SetActive(false);
        ResourcesMgr.Instance.RecoveryAll();
        if (GlobalData.hasHeap)
        {
            foreach (BattleAreaItem areaItem in View.battleAreaItems)
            {
                BattleAreaUtil.InitHeapCard(areaItem, GlobalData.CardWare.Length);
            }
        }
        yield return(new WaitForSeconds(4f));

        HideRotaeSaizi();
        //Facade.SendNotification(NotificationConstant.HIDESAIZI);

        var selfInfoVO     = battleProxy.playerIdInfoDic[playerInfoProxy.userID];
        var sendStartIndex = (battleProxy.GetBankerPlayerInfoVOS2C().sit - selfInfoVO.sit + GlobalData.SIT_NUM) % GlobalData.SIT_NUM;

        for (int i = 0; i < View.battleAreaItems.Count; i++)
        {
            View.battleAreaItems[i].SetData(battleProxy.playerSitInfoDic[GlobalData.GetNextSit(selfInfoVO.sit, i)]);
        }
        int sendCount = Mathf.CeilToInt((float)GlobalData.PLAYER_CARD_NUM / GlobalData.SEND_SINGLE) * GlobalData.SIT_NUM;

        for (int i = 0; i < sendCount; i++)
        {
            GameMgr.Instance.StartCoroutine(View.battleAreaItems[(i + sendStartIndex) % GlobalData.SIT_NUM].PlaySendCardAnimator());
            yield return(new WaitForSeconds(0.4f));
        }
        yield return(new WaitForSeconds(0.5f));

        for (int i = 0; i < View.battleAreaItems.Count; i++)
        {
            GameMgr.Instance.StartCoroutine(View.battleAreaItems[i].PlayCloseCardAction());
        }
        yield return(new WaitForSeconds(0.83f));

        ClientAIMgr.Instance.AIPutCard();
        battleProxy.SetIsForbit(false);
        SendNotification(NotificationConstant.MEDI_BATTLE_PLAYACTTIP);
    }
예제 #2
0
    /// <summary>
    /// 播放发牌动画
    /// </summary>
    private IEnumerator PlaySendCardAnimator()
    {
        //发牌之前先回收之前的牌
        foreach (BattleAreaItem areaItem in View.battleAreaItems)
        {
            areaItem.SaveAllCard();
        }
        View.cardArrowIcon.SetActive(false);
        if (GlobalData.hasHeap)
        {
            foreach (BattleAreaItem areaItem in View.battleAreaItems)
            {
                BattleAreaUtil.InitHeapCard(areaItem, GlobalData.CardWare.Length);
            }
        }
        var selfInfoVO     = battleProxy.playerIdInfoDic[playerInfoProxy.UserInfo.UserID];
        var sendStartIndex = (battleProxy.BankerPlayerInfoVOS2C.sit - selfInfoVO.sit + GlobalData.SIT_NUM) % GlobalData.SIT_NUM;

        for (int i = 0; i < View.battleAreaItems.Count; i++)
        {
            View.battleAreaItems[i].SetData(battleProxy.playerSitInfoDic[GlobalData.GetNextSit(selfInfoVO.sit, i)]);
        }
        //if (GlobalData.LoginServer != "127.0.0.1")
        //{
        int sendCount = Mathf.CeilToInt((float)GlobalData.PLAYER_CARD_NUM / GlobalData.SEND_SINGLE) * GlobalData.SIT_NUM;

        for (int i = 0; i < sendCount; i++)
        {
            GameMgr.Instance.StartCoroutine(View.battleAreaItems[(i + sendStartIndex) % GlobalData.SIT_NUM].PlaySendCardAnimator());
            yield return(new WaitForSeconds(0.4f));
        }
        yield return(new WaitForSeconds(0.5f));

        SendNotification(NotificationConstant.MEDI_BATTLE_UPDATEOOMMESSAGES);
        for (int i = 0; i < View.battleAreaItems.Count; i++)
        {
            GameMgr.Instance.StartCoroutine(View.battleAreaItems[i].PlayCloseCardAction());
        }
        //}
        yield return(new WaitForSeconds(0.83f));

        battleProxy.isForbit = false;

        SendNotification(NotificationConstant.MEDI_BATTLE_PLAYACTTIP);
    }