Esempio n. 1
0
    IEnumerator DoActionShowEffAtkUno(Uno_PlayerGroup _playerAtk, Uno_PlayerGroup _playerBeAttacked)
    {
        Uno_EffectAttackUno_Sword_Controller _effectSword = LeanPool.Spawn(effAtkUnoSwordPrefab, Vector3.zero, Quaternion.identity).GetComponent <Uno_EffectAttackUno_Sword_Controller>();

        effectPoolManager.AddObject(_effectSword);
        _effectSword.transform.position = _playerAtk.panelPlayerInfo.transform.position;

        if (Uno_GamePlay_Manager.instance.CanPlayMusicAndSfx())
        {
            MyAudioManager.instance.PlaySfx(Uno_GamePlay_Manager.instance.myAudioInfo.sfx_AtkUno_Charge);
        }

        yield return(_effectSword.SetUpMove(_playerBeAttacked.panelPlayerInfo.transform.position));

        if (Uno_GamePlay_Manager.instance.CanPlayMusicAndSfx())
        {
            MyAudioManager.instance.PlaySfx(Uno_GamePlay_Manager.instance.myAudioInfo.sfx_AtkUno_Hit);
        }

        MySimplePoolObjectController _effectHit = LeanPool.Spawn(effAtkUnoHitPrefab, Vector3.zero, Quaternion.identity).GetComponent <MySimplePoolObjectController>();

        effectPoolManager.AddObject(_effectHit);
        _effectHit.transform.position = _playerBeAttacked.panelPlayerInfo.transform.position;
        _playerBeAttacked.panelPlayerInfo.myShakeController.SetUpShakeLocalPoint(0.3f, 10f);
        yield return(Yielders.Get(0.5f));
    }
Esempio n. 2
0
    public Coroutine ChangeView(Uno_PlayerGroup _myPlayerGroup)
    {
        if (isChangingView)
        {
            return(null);
        }

        if (_myPlayerGroup != null)
        {
            if (_myPlayerGroup.viewIndex != 2)
            {
                actionChangeView = DoActionChangeView(_myPlayerGroup);
                return(StartCoroutine(actionChangeView));
            }
            else
            {
                _myPlayerGroup.ShowButtonStandUp(false);
                return(null);
            }
        }
        else
        {
            if (Uno_GamePlay_Manager.instance.listPlayerGroup[0].realIndex != Uno_GamePlay_Manager.instance.listPlayerGroup[0].viewIndex)
            {
                actionChangeView = DoActionChangeView(null);
                return(StartCoroutine(actionChangeView));
            }
        }

        return(null);
    }
Esempio n. 3
0
    public void DealCard()
    {
        Uno_PlayerGroup _myPlayerGroup = null;

        for (int i = 0; i < uno_GamePlay_Manager.listPlayerGroup.Count; i++)
        {
            _myPlayerGroup = uno_GamePlay_Manager.listPlayerGroup[i];
            if (_myPlayerGroup.isInitialized)
            {
                uno_GamePlay_Manager.UIManager.DealPlayerCard(_myPlayerGroup, 0, 0.1f, null);
            }
        }
    }
Esempio n. 4
0
    public void RefreshUIButtonSitDown()
    {
        if (unoGamePlayData.CheckIsPlaying(DataManager.instance.userData.sessionId) ||
            unoGamePlayData.listSessionIdOnChair.Contains(DataManager.instance.userData.sessionId))
        {
            for (int i = 0; i < Uno_GamePlay_Manager.instance.listPlayerGroup.Count; i++)
            {
                Uno_GamePlay_Manager.instance.listPlayerGroup[i].HideButtonSitDown();
            }
            HideMyPanelUserInfo();
            return;
        }

        ShowMyPanelUserInfo();

        List <int> _listIndexChairPlaying = new List <int>();

        for (int i = 0; i < unoGamePlayData.listPlayerPlayingData.Count; i++)
        {
            int _indexChair = unoGamePlayData.listPlayerPlayingData[i].indexChair;
            Uno_GamePlay_Manager.instance.listPlayerGroup[_indexChair].HideButtonSitDown();
            _listIndexChairPlaying.Add(_indexChair);
        }
        List <int> _listIndexChairWaiting = new List <int>();

        for (int i = 0; i < unoGamePlayData.numberChairs; i++)
        {
            if (!_listIndexChairPlaying.Contains(i))
            {
                _listIndexChairWaiting.Add(i);
            }
        }
        Uno_PlayerGroup _playerGroup = null;

        for (int i = 0; i < _listIndexChairWaiting.Count; i++)
        {
            int   _indexChair = _listIndexChairWaiting[i];
            short _sessionId  = unoGamePlayData.listSessionIdOnChair[_indexChair];
            _playerGroup = Uno_GamePlay_Manager.instance.listPlayerGroup[_indexChair];
            UserDataInGame _userData = unoGamePlayData.GetUserDataInGameFromListGlobal(_sessionId);
            if (_userData == null)
            {
                _playerGroup.ShowButtonSitDown();
            }
            else
            {
                _playerGroup.HideButtonSitDown();
            }
        }
    }
Esempio n. 5
0
 public Coroutine DealPlayerCard(Uno_PlayerGroup _playerGroup, sbyte _valueCards = -1, float _timeDeal = 0f, System.Action _onFinished = null)
 {
     if (!_playerGroup.isInitialized)
     {
                     #if TEST
         Debug.LogError("Chưa Init Player");
                     #endif
         if (_onFinished != null)
         {
             _onFinished();
         }
         return(null);
     }
     return(StartCoroutine(DoActionDealPlayerCard(_playerGroup, _valueCards, _timeDeal, _onFinished)));
 }
Esempio n. 6
0
    public CardHolderController CreateCardHolder(Uno_PlayerGroup _playerGroup)
    {
        CardHolderController _cardHolder = null;

        if (_playerGroup.isMe &&
            unoGamePlayData.CheckIsPlaying(_playerGroup.userData.sessionId))
        {
            _cardHolder = LeanPool.Spawn(ownCardHolderPrefab, Vector3.zero, Quaternion.identity, panelContainOwnCardHolder).GetComponent <CardHolderController>();
        }
        else
        {
            _cardHolder = LeanPool.Spawn(playerCardHolderPrefab, Vector3.zero, Quaternion.identity, listPanelContainPlayerCardsHolder[_playerGroup.viewIndex]).GetComponent <CardHolderController>();
        }
        _cardHolder.transform.localRotation = Quaternion.identity;
        return(_cardHolder);
    }
Esempio n. 7
0
    IEnumerator DoActionMoveAllToPosPlaying(bool _updateNow)
    {
        List <IEnumerator> _listProgess = new List <IEnumerator>();

        for (int i = 0; i < Uno_GamePlay_Manager.instance.listPlayerGroup.Count; i++)
        {
            Uno_PlayerGroup _playerGroup = Uno_GamePlay_Manager.instance.listPlayerGroup[i];
            if (_playerGroup.isInitialized)
            {
                _listProgess.Add(DoActionMoveToPosPlaying(_playerGroup, _updateNow));
            }
        }
        yield return(CoroutineChain.Start
                     .Parallel(_listProgess.ToArray()));

        actionMoveToPosPlayingOrWaiting = null;
    }
Esempio n. 8
0
    IEnumerator DoActionLeftBan()
    {
        Uno_PlayerGroup _myPlayerGroup = null;

        for (int i = 0; i < uno_GamePlay_Manager.listPlayerGroup.Count; i++)
        {
            _myPlayerGroup = uno_GamePlay_Manager.listPlayerGroup[i];
            if (_myPlayerGroup.isInitialized &&
                !_myPlayerGroup.isMe)
            {
                _myPlayerGroup.HideAndClear();
                LeanTween.scale(_myPlayerGroup.panelPlayerInfo.gameObject, Vector3.one, 0.2f)
                .setEase(LeanTweenType.easeOutBack);
                yield return(Yielders.Get(0.2f));
            }
        }
    }
Esempio n. 9
0
    IEnumerator DoActionJoinBan()
    {
        UserDataInGame _userData = DataManager.instance.userData.CastToUserDataInGame();

        yield return(null);

        Uno_PlayerGroup _myPlayerGroup = null;

        for (int i = 0; i < uno_GamePlay_Manager.listPlayerGroup.Count; i++)
        {
            _myPlayerGroup = uno_GamePlay_Manager.listPlayerGroup[i];
            if (!_myPlayerGroup.isInitialized)
            {
                _myPlayerGroup.InitData(_userData);
                LeanTween.scale(_myPlayerGroup.panelPlayerInfo.gameObject, Vector3.one * uno_GamePlay_Manager.UIManager.listPlaceHolderPanelPlayerInfo_Wating[_myPlayerGroup.realIndex].ratioScale, 0.2f)
                .setEase(LeanTweenType.easeOutBack);
                yield return(Yielders.Get(0.2f));
            }
        }
    }
Esempio n. 10
0
 IEnumerator DoActionMoveAllToPosWaiting(bool _updateNow)
 {
     for (int i = 0; i < Uno_GamePlay_Manager.instance.listPlayerGroup.Count; i++)
     {
         Uno_PlayerGroup _playerGroup = Uno_GamePlay_Manager.instance.listPlayerGroup[i];
         // if(_playerGroup.isInitialized){
         if (_updateNow)
         {
             _playerGroup.panelContainerPlayerInfo.transform.position = listPlaceHolderPanelPlayerInfo_Wating[_playerGroup.viewIndex].transform.position;
         }
         else
         {
             LeanTween.move(_playerGroup.panelContainerPlayerInfo.gameObject, listPlaceHolderPanelPlayerInfo_Wating[_playerGroup.viewIndex].transform.position, 0.2f);
         }
         // }
     }
     if (!_updateNow)
     {
         yield return(Yielders.Get(0.3f));
     }
     actionMoveToPosPlayingOrWaiting = null;
 }
Esempio n. 11
0
    public IEnumerator DoActionMoveToPosPlaying(Uno_PlayerGroup _playerGroup, bool _updateNow)
    {
        if (!_playerGroup.isInitialized)
        {
            yield break;
        }
        bool _isFinished = false;

        if (_playerGroup.isMe &&
            unoGamePlayData.CheckIsPlaying(_playerGroup.userData.sessionId))
        {
            if (_updateNow)
            {
                _playerGroup.panelContainerPlayerInfo.transform.position = placeHolderMyPanelInfo_Playing.transform.position;
                _isFinished = true;
            }
            else
            {
                LeanTween.move(_playerGroup.panelContainerPlayerInfo.gameObject, placeHolderMyPanelInfo_Playing.transform.position, 0.2f).setOnComplete(() => {
                    _isFinished = true;
                });
            }
        }
        else
        {
            if (_updateNow)
            {
                _playerGroup.panelContainerPlayerInfo.transform.position = listPlaceHolderPanelPlayerInfo_Playing[_playerGroup.viewIndex].transform.position;
                _isFinished = true;
            }
            else
            {
                LeanTween.move(_playerGroup.panelContainerPlayerInfo.gameObject, listPlaceHolderPanelPlayerInfo_Playing[_playerGroup.viewIndex].transform.position, 0.2f).setOnComplete(() => {
                    _isFinished = true;
                });
            }
        }
        yield return(new WaitUntil(() => _isFinished));
    }
Esempio n. 12
0
    public IEnumerator DoActionPrepareToStartGame()
    {
        panelTotalBet.SetBet(0);
        panelTotalBet.Show(false);

        List <IEnumerator> _listActionShowEffGoldFly = new List <IEnumerator>();

        for (int i = 0; i < unoGamePlayData.listPlayerPlayingData.Count; i++)
        {
            int             _indexChair  = unoGamePlayData.listPlayerPlayingData[i].indexChair;
            Uno_PlayerGroup _playerGroup = Uno_GamePlay_Manager.instance.listPlayerGroup[_indexChair];
            Vector2         _startPoint  = _playerGroup.panelPlayerInfo.transform.position;
            Vector2         _endPoint    = panelTotalBet.imgIconChip.transform.position;

            _listActionShowEffGoldFly.Add(MyConstant.DoActionShowEffectGoldFly(goldPrefab, goldObjectPoolManager, sortingLayerManager.sortingLayerInfo_GoldObject
                                                                               , _startPoint, _endPoint, 10, 1f, 0.8f, () => {
                if (Uno_GamePlay_Manager.instance.CanPlayMusicAndSfx())
                {
                    MyAudioManager.instance.PlaySfx(GameInformation.instance.globalAudioInfo.sfx_Gold);
                }
            }));
        }

        CoroutineChain.Start
        .Parallel(_listActionShowEffGoldFly.ToArray());
        yield return(Yielders.Get(1.1f));

        if (Uno_GamePlay_Manager.instance.CanPlayMusicAndSfx())
        {
            MyAudioManager.instance.PlaySfx(Uno_GamePlay_Manager.instance.myAudioInfo.sfx_Bet);
        }
        panelTotalBet.SetBet(unoGamePlayData.totalBet, false);
        SetTableBet(unoGamePlayData.currentBet);
        yield return(Yielders.Get(1f));

        yield return(panelTotalBet.Hide(false));
    }
Esempio n. 13
0
    void RefreshAllPlayerGroupUINow()
    {
        if (unoGamePlayData.currentGameState == UnoGamePlayData.GameState.STATUS_WAIT_FOR_PLAYER)
        {
            for (int i = 0; i < unoGamePlayData.listSessionIdOnChair.Count; i++)
            {
                if (unoGamePlayData.listSessionIdOnChair[i] < 0)                 // ghế trống
                {
                    continue;
                }
                for (int j = 0; j < unoGamePlayData.listGlobalPlayerData.Count; j++)
                {
                    if (unoGamePlayData.listSessionIdOnChair[i] == unoGamePlayData.listGlobalPlayerData[j].sessionId)
                    {
                        Uno_GamePlay_Manager.instance.listPlayerGroup[i].InitData(unoGamePlayData.listGlobalPlayerData[j]);
                        Uno_GamePlay_Manager.instance.listPlayerGroup[i].panelPlayerInfo.transform.localScale = Vector3.one * listPlaceHolderPanelPlayerInfo_Wating[i].ratioScale;
                        break;
                    }
                }
            }
            MoveAllToPosWaiting();
        }
        else
        {
            List <int> _listIndexChairPlaying = new List <int>();
            for (int i = 0; i < unoGamePlayData.listPlayerPlayingData.Count; i++)
            {
                _listIndexChairPlaying.Add(unoGamePlayData.listPlayerPlayingData[i].indexChair);
                int _indexChair = unoGamePlayData.listPlayerPlayingData[i].indexChair;

                Uno_PlayerGroup _playerGroup = Uno_GamePlay_Manager.instance.listPlayerGroup[_indexChair];
                _playerGroup.InitData(unoGamePlayData.listPlayerPlayingData[i].userData);
                if (_playerGroup.isMe)
                {
                                        #if TEST
                    Debug.LogError(">>> Bug logic (0)");
                                        #endif
                    _playerGroup.panelPlayerInfo.transform.localScale = Vector3.one * placeHolderMyPanelInfo_Playing.ratioScale;
                }
                else
                {
                    _playerGroup.panelPlayerInfo.transform.localScale = Vector3.one * listPlaceHolderPanelPlayerInfo_Playing[_playerGroup.viewIndex].ratioScale;
                }

                for (int j = 0; j < unoGamePlayData.listPlayerPlayingData[i].ownCards.Count; j++)
                {
                    DealPlayerCard(_playerGroup, unoGamePlayData.listPlayerPlayingData[i].ownCards[j], 0f, null);
                }
            }
            MoveAllToPosPlaying();

            // --- hiện các thông tin người chơi đang chờ --- //
            List <int> _listIndexChairWaiting = new List <int>();
            for (int i = 0; i < unoGamePlayData.numberChairs; i++)
            {
                if (!_listIndexChairPlaying.Contains(i))
                {
                    _listIndexChairWaiting.Add(i);
                }
            }
            for (int i = 0; i < _listIndexChairWaiting.Count; i++)
            {
                int            _indexChair = _listIndexChairWaiting[i];
                short          _sessionId  = unoGamePlayData.listSessionIdOnChair[_indexChair];
                UserDataInGame _userData   = unoGamePlayData.GetUserDataInGameFromListGlobal(_sessionId);
                if (_userData == null)
                {
                    continue;
                }
                Uno_PlayerGroup _playerGroup = Uno_GamePlay_Manager.instance.listPlayerGroup[_indexChair];
                _playerGroup.InitAsIncognito(_userData);
                LeanTween.scale(_playerGroup.panelPlayerInfo.gameObject, Vector3.one * listPlaceHolderPanelPlayerInfo_Wating[_playerGroup.realIndex].ratioScale, 0.2f)
                .setEase(LeanTweenType.easeOutBack);
            }
        }
    }
Esempio n. 14
0
    IEnumerator DoActionChangeView(Uno_PlayerGroup _myPlayerGroup)      // nếu _myViewIndex = -1 tức là mình đã đứng dậy
    {
        int  _tmpDelta    = 0;
        int  _deltaAngleZ = 0;
        bool _isFinished  = false;

        if (_myPlayerGroup == null)
        {
            _tmpDelta = Uno_GamePlay_Manager.instance.listPlayerGroup[0].viewIndex;
            for (int i = 0; i < Uno_GamePlay_Manager.instance.listPlayerGroup.Count; i++)
            {
                int _newIndexView = Uno_GamePlay_Manager.instance.listPlayerGroup[i].realIndex;
                Uno_GamePlay_Manager.instance.listPlayerGroup[i].viewIndex = _newIndexView;
            }
        }
        else
        {
            if (_myPlayerGroup.viewIndex < 2)
            {
                _tmpDelta = 2 - _myPlayerGroup.viewIndex;
            }
            else if (_myPlayerGroup.viewIndex > 2)
            {
                _tmpDelta = 2 + 4 - _myPlayerGroup.viewIndex;
            }
            for (int i = 0; i < Uno_GamePlay_Manager.instance.listPlayerGroup.Count; i++)
            {
                int _newIndexView = (Uno_GamePlay_Manager.instance.listPlayerGroup[i].viewIndex + _tmpDelta) % 4;
                Uno_GamePlay_Manager.instance.listPlayerGroup[i].viewIndex = _newIndexView;
            }
        }
        _deltaAngleZ = _tmpDelta * 90;

        yield return(null);

        for (int i = 0; i < Uno_GamePlay_Manager.instance.listPlayerGroup.Count; i++)
        {
            LeanTween.move(Uno_GamePlay_Manager.instance.listPlayerGroup[i].panelContainerPlayerInfo.gameObject, panelRotate.GetChild(i).position, timeStepChangeView).setEase(LeanTweenType.easeOutSine);
        }
        yield return(Yielders.Get(timeStepChangeView));

        actionPanelPlayerInfoFollowTmpPanel = DoActionPanelPlayerInfoFollowTmpPanel();
        StartCoroutine(actionPanelPlayerInfoFollowTmpPanel);

        _isFinished = false;
        // float _z = 0;

        if (_myPlayerGroup == null)
        {
            // _z = 0 - _deltaAngleZ;
            LeanTween.rotateAround(panelRotate.gameObject, Vector3.forward, _deltaAngleZ, timeStepChangeView).setOnComplete(() => {
                _isFinished = true;
            }).setEase(LeanTweenType.easeOutSine);
        }
        else
        {
            // _z = panelRotate.rotation.eulerAngles.z - _deltaAngleZ;
            LeanTween.rotateAround(panelRotate.gameObject, Vector3.forward, -_deltaAngleZ, timeStepChangeView).setOnComplete(() => {
                _isFinished = true;
            }).setEase(LeanTweenType.easeOutSine);
        }

        yield return(new WaitUntil(() => _isFinished));

        StopCoroutine(actionPanelPlayerInfoFollowTmpPanel);
        actionPanelPlayerInfoFollowTmpPanel = null;

        for (int i = 0; i < Uno_GamePlay_Manager.instance.listPlayerGroup.Count; i++)
        {
            LeanTween.move(Uno_GamePlay_Manager.instance.listPlayerGroup[i].panelContainerPlayerInfo.gameObject, listPlaceHolderPanelPlayerInfo_Wating[Uno_GamePlay_Manager.instance.listPlayerGroup[i].viewIndex].transform.position, timeStepChangeView).setEase(LeanTweenType.easeOutSine);
        }
        yield return(Yielders.Get(timeStepChangeView));

        if (_myPlayerGroup != null)
        {
            _myPlayerGroup.ShowButtonStandUp(false);
        }

        actionChangeView = null;
    }
Esempio n. 15
0
 public Coroutine ShowEffAtkUno(Uno_PlayerGroup _playerAtk, Uno_PlayerGroup _playerBeAttacked)
 {
     return(StartCoroutine(DoActionShowEffAtkUno(_playerAtk, _playerBeAttacked)));
 }
Esempio n. 16
0
    public IEnumerator DoActionShowGoldWinToPlayerAtFinishGame(UnoGamePlayData.Uno_FinishGame_Data _finishGameData, System.Action _onFinished)
    {
        double _totalBet = unoGamePlayData.totalBet * 0.95;

        panelTotalBet.SetBet((long)_totalBet);
        yield return(panelTotalBet.Show(false));

        yield return(null);

        List <IEnumerator>     _listActionShowEffGoldFly = new List <IEnumerator>();
        List <Uno_PlayerGroup> _tmpListPlayerGroup       = new List <Uno_PlayerGroup>();

        for (int i = 0; i < _finishGameData.listPlayersData.Count; i++)
        {
            UnoGamePlayData.Uno_FinishGame_Data.Player_Data _playerFinish = _finishGameData.listPlayersData[i];
            if (!_playerFinish.isWin)
            {
                continue;
            }
            UnoGamePlayData.Uno_PlayerPlayingData _playerPlayingData = unoGamePlayData.listPlayerPlayingData[_playerFinish.indexCircle];
            int             _indexChair  = _playerPlayingData.indexChair;
            Uno_PlayerGroup _playerGroup = Uno_GamePlay_Manager.instance.listPlayerGroup[_indexChair];
            _tmpListPlayerGroup.Add(_playerGroup);
            Vector2 _startPoint = panelTotalBet.imgIconChip.transform.position;
            Vector2 _endPoint   = _playerGroup.panelPlayerInfo.transform.position;

            _listActionShowEffGoldFly.Add(MyConstant.DoActionShowEffectGoldFly(goldPrefab, goldObjectPoolManager, sortingLayerManager.sortingLayerInfo_GoldObject
                                                                               , _startPoint, _endPoint, 10, 1f, 0.8f, () => {
                if (Uno_GamePlay_Manager.instance.CanPlayMusicAndSfx())
                {
                    MyAudioManager.instance.PlaySfx(GameInformation.instance.globalAudioInfo.sfx_Gold);
                }
            }));
        }
        CoroutineChain.Start
        .Parallel(_listActionShowEffGoldFly.ToArray());
        yield return(Yielders.Get(1.1f));

        panelTotalBet.SetBet(0, false);

        if (_tmpListPlayerGroup.Count > 0)
        {
            if (Uno_GamePlay_Manager.instance.CanPlayMusicAndSfx())
            {
                MyAudioManager.instance.PlaySfx(GameInformation.instance.globalAudioInfo.sfx_Gold);
            }
        }

        for (int i = 0; i < _tmpListPlayerGroup.Count; i++)
        {
            Vector3 _posStartPanelGoldBonus = _tmpListPlayerGroup[i].panelPlayerInfo.imgAvatar.transform.position;
            StartCoroutine(MyConstant.DoActionShowPopupWinGold(panelBonusGoldPrefab, effectPoolManager, Uno_GamePlay_Manager.instance.myCanvas.transform
                                                               , _posStartPanelGoldBonus, 0f, _finishGameData.goldWin));
            _tmpListPlayerGroup[i].panelPlayerInfo.RefreshGoldInfo();
        }
        if (myPanelUserInfo.currentState == PanelUserInfoInGameController.State.Show)
        {
            myPanelUserInfo.RefreshGoldInfo();
        }
        else
        {
            myPanelUserInfo.RefreshGoldInfo(true);
        }

        yield return(Yielders.Get(0.5f));

        yield return(panelTotalBet.Hide(false));

        if (_onFinished != null)
        {
            _onFinished();
        }
    }
Esempio n. 17
0
    IEnumerator DoActionDealPlayerCard(Uno_PlayerGroup _playerGroup, sbyte _valueCards, float _timeDeal, System.Action _onFinished)
    {
        CardUnoInfo _cardInfo = null;

        if (_valueCards >= 0 && _playerGroup.isMe &&
            unoGamePlayData.CheckIsPlaying(DataManager.instance.userData.sessionId))
        {
            _cardInfo = Uno_GamePlay_Manager.instance.GetCardInfo(_valueCards);
        }

        CardHolderController         _cardHolder = CreateCardHolder(_playerGroup);
        PanelCardUnoDetailController _card       = LeanPool.Spawn(cardPrefab, Vector3.zero, Quaternion.identity, panelContainAllPlayerCards).GetComponent <PanelCardUnoDetailController>();

        _card.transform.position = dealer.position;
        _card.transform.rotation = dealer.rotation;
        if (_cardInfo != null)
        {
            _card.ShowNow(_cardInfo, _valueCards);
        }
        _card.SetCardHolder(_cardHolder);
        _card.ResizeAgain(sizeCardDefault.x, sizeCardDefault.y);
        _playerGroup.ownCardPoolManager.AddObject(_card);
        yield return(Yielders.EndOfFrame);

        bool _canCompactCard = true;

        if (_playerGroup.isMe &&
            unoGamePlayData.CheckIsPlaying(DataManager.instance.userData.sessionId))
        {
            _canCompactCard = false;
        }

        if (_timeDeal <= 0)
        {
            for (int i = 0; i < _playerGroup.ownCardPoolManager.listObjects.Count; i++)
            {
                PanelCardUnoDetailController _panelCardDetail = (PanelCardUnoDetailController)_playerGroup.ownCardPoolManager.listObjects[i];
                _panelCardDetail.transform.position   = _panelCardDetail.cardHolder.transform.position;
                _panelCardDetail.transform.rotation   = _panelCardDetail.cardHolder.transform.rotation;
                _panelCardDetail.transform.localScale = Vector2.one * _panelCardDetail.cardHolder.ratioScale;
            }
            if (_canCompactCard && _playerGroup.ownCardPoolManager.listObjects.Count > numCardsCompact)
            {
                for (int i = 0; i < _playerGroup.ownCardPoolManager.listObjects.Count; i++)
                {
                    PanelCardUnoDetailController _panelCardDetail = (PanelCardUnoDetailController)_playerGroup.ownCardPoolManager.listObjects[i];
                    _panelCardDetail.transform.position = listPanelContainPlayerCardsCompactHolder[_playerGroup.viewIndex].position;
                    if (i == 0)
                    {
                        _panelCardDetail.SetVisible();
                    }
                    else
                    {
                        _panelCardDetail.SetInVisible();
                    }
                }
                listTxtPlayerNumberCards[_playerGroup.viewIndex].gameObject.SetActive(true);
                listTxtPlayerNumberCards[_playerGroup.viewIndex].text = _playerGroup.ownCardPoolManager.listObjects.Count.ToString();
            }
            else
            {
                listTxtPlayerNumberCards[_playerGroup.viewIndex].gameObject.SetActive(false);
            }
        }
        else
        {
            if (Uno_GamePlay_Manager.instance.CanPlayMusicAndSfx())
            {
                MyAudioManager.instance.PlaySfx(Uno_GamePlay_Manager.instance.myAudioInfo.sfx_DealCard);
            }

            if (_canCompactCard && _playerGroup.ownCardPoolManager.listObjects.Count > numCardsCompact)
            {
                for (int i = 0; i < _playerGroup.ownCardPoolManager.listObjects.Count - 1; i++)
                {
                    PanelCardUnoDetailController _panelCardDetail = (PanelCardUnoDetailController)_playerGroup.ownCardPoolManager.listObjects[i];
                    StartCoroutine(_panelCardDetail.Move(listPanelContainPlayerCardsCompactHolder[_playerGroup.viewIndex].position, _timeDeal / 2f, LeanTweenType.easeOutSine));
                }
                yield return(CoroutineChain.Start
                             .Parallel(_card.Move(listPanelContainPlayerCardsCompactHolder[_playerGroup.viewIndex].position, _timeDeal, LeanTweenType.easeOutSine)
                                       , _card.Rotate(_cardHolder.transform.rotation.eulerAngles, _timeDeal)
                                       , _card.ScaleTo(Vector2.one * _cardHolder.ratioScale, _timeDeal, LeanTweenType.notUsed)));

                for (int i = 0; i < _playerGroup.ownCardPoolManager.listObjects.Count; i++)
                {
                    PanelCardUnoDetailController _panelCardDetail = (PanelCardUnoDetailController)_playerGroup.ownCardPoolManager.listObjects[i];
                    if (i == 0)
                    {
                        _panelCardDetail.SetVisible();
                    }
                    else
                    {
                        _panelCardDetail.SetInVisible();
                    }
                }
                listTxtPlayerNumberCards[_playerGroup.viewIndex].gameObject.SetActive(true);
                listTxtPlayerNumberCards[_playerGroup.viewIndex].text = _playerGroup.ownCardPoolManager.listObjects.Count.ToString();
            }
            else
            {
                CoroutineChain.Start
                .Parallel(_card.MoveToCardHolder(_timeDeal, LeanTweenType.easeOutSine)
                          , _card.Rotate(_cardHolder.transform.rotation.eulerAngles, _timeDeal)
                          , _card.ScaleTo(Vector2.one * _cardHolder.ratioScale, _timeDeal, LeanTweenType.notUsed));
                yield return(Yielders.Get(_timeDeal / 2f));

                for (int i = 0; i < _playerGroup.ownCardPoolManager.listObjects.Count - 1; i++)
                {
                    PanelCardUnoDetailController _panelCardDetail = (PanelCardUnoDetailController)_playerGroup.ownCardPoolManager.listObjects[i];
                    StartCoroutine(_panelCardDetail.MoveToCardHolder(_timeDeal / 2f, LeanTweenType.easeOutSine));
                }
                yield return(Yielders.Get(_timeDeal / 2f));
            }
        }

        if (_valueCards >= 0 && _playerGroup.isMe &&
            unoGamePlayData.CheckIsPlaying(DataManager.instance.userData.sessionId))
        {
            _card.onPointerDown = _playerGroup.OnFocusCard;
        }
        if (_onFinished != null)
        {
            _onFinished();
        }
    }