//结果显示 private void Result() { if (liuliu.tOCardsDtos != null) { //给链表赋值 List <Game2CardDto> tOCards = liuliu.tOCardsDtos.cardDtoList; for (int i = 0; i < tOCards.Count; i++) { Game2CardDto tOCardsDto = tOCards[i]; if (tOCardsDto.position != 0) { cardTypeShowList[tOCardsDto.position].sprite = cardTypeList[liuliu.tOCardsDtos.cardDtoList[i].cardType]; cardTypeShowList[tOCardsDto.position].gameObject.SetActive(true); if (liuliu.tOCardsDtos.cardDtoList[i].result) { showResultImage(tOCardsDto.position - 1, 1); } else { showResultImage(tOCardsDto.position - 1, 0); } } } } }
//更换他们的图片 private void Show(Game2CardDto todto, int i) { if (showCache[i].Count != 0) { for (int j = 0; j < todto.cardIds.Count; j++) { Image go = showCache[i][j]; int cardId = todto.cardIds[j]; go.overrideSprite = cardDict[cardId]; } } }
IEnumerator show(Game2CardListDto tOCardsDtos) { for (int i = 0; i < tOCardsDtos.cardDtoList.Count; i++) { yield return(new WaitForSeconds(.7f)); //将每堆牌的Dto初始化为空 Game2CardDto todto = null; todto = tOCardsDtos.cardDtoList[i]; Show(todto, i); Vector3 v3 = FallCardPosList[i].localPosition; v3.y -= 15; } Result(); }