private void doDragBaoCard() { // 第一次确定宝 if (list.Count == 0) { NextGroup.SetActive(); NextGroup.doDragBaoCard(); } else if (list.Count == 1) { NextGroup.doDragBaoCard(); } else { int index = 0; if (list.Count % 2 != 0) { index = 1; } Transform card = list[index]; Game.PoolManager.CardPool.Despawn(card.gameObject); list.RemoveAt(index); Game.MJMgr.CardLeft--; } }
private void doTryDragCard(bool countdown) { print(" trt drag card loop " + countdown + " - " + Game.MJTable.DiceNum + " = " + list.Count + " | " + IsFirstGroup + " - " + firstGroupIndex + " ] "); if (firstDrag && IsFirstGroup) //从第一组顺序为diceNum * 2的牌开始摸 { int zhuangNum = Game.MJTable.DiceNum * 2; if (list.Count <= zhuangNum) //因为是从zhuangNum开始摸的,所以摸完的条件是list剩余牌数<=zhuangNum。 { NextGroup.SetActive(); NextGroup.doTryDragCard(countdown); } else { Transform card = list[zhuangNum]; Game.PoolManager.CardPool.Despawn(card.gameObject); list.RemoveAt(zhuangNum); if (countdown) { Game.MJMgr.CardLeft--; } } } else { firstDrag = false;//TODO WXD 时机不准确 if (list.Count > 0) { Transform card = list[0]; Game.PoolManager.CardPool.Despawn(card.gameObject); list.RemoveAt(0); if (countdown) { Game.MJMgr.CardLeft--; } } else { NextGroup.SetActive(); NextGroup.doTryDragCard(countdown); } } }
private void doTryDragCard(bool countdown) { // return; // Debug.Log("***************************************" + Game.MJMgr.CardLeft); // if(Game.MJMgr.CardLeft <= 8) // return; if (IsFirstGroup) { int zhuangNum = Game.MJTable.DiceNum * 2; /////////////////////////////////////////// if (Game.MJMgr.CardLeft <= zhuangNum) { Transform card = list[0]; Game.PoolManager.CardPool.Despawn(card.gameObject); list.RemoveAt(0); return; } /////////////////////////////////////////// if (list.Count <= zhuangNum) { NextGroup.SetActive(); NextGroup.doTryDragCard(countdown); } else { Transform card = list[zhuangNum]; Game.PoolManager.CardPool.Despawn(card.gameObject); list.RemoveAt(zhuangNum); if (countdown) { // Game.MJMgr.CardLeft--; } } } else { if (list.Count > 0) { Transform card = list[0]; Game.PoolManager.CardPool.Despawn(card.gameObject); list.RemoveAt(0); if (countdown) { if (Game.MJMgr.bStart == false) { // Game.MJMgr.CardLeft--; Debug.LogWarningFormat("CardLeft:{0}", Game.MJMgr.CardLeft); } else { Game.MJMgr.bStart = false; Debug.LogWarningFormat("CardLeft:{0}", Game.MJMgr.CardLeft); } } } else { NextGroup.SetActive(); NextGroup.doTryDragCard(countdown); } } }