/// <summary> /// 卡牌排序 /// </summary> /// <param name="cards"></param> private void Sort(List <Card> cards) { CardHelper.Sort(cards); //卡牌精灵层级排序 //Log.Debug("重设卡牌精灵层级"); for (int i = 0; i < cards.Count; i++) { //Log.Debug("卡牌精灵" + cards[i].GetName()); GetSprite(cards[i]).transform.SetSiblingIndex(i); } }
/// <summary> /// 出牌 /// </summary> private async void OnPlay() { CardHelper.Sort(currentSelectCards); Actor_GamerPlayCard_Req request = new Actor_GamerPlayCard_Req(); foreach (var a in currentSelectCards) { request.Cards.Add(a); } Actor_GamerPlayCard_Back response = (Actor_GamerPlayCard_Back)await SessionComponent.Instance.Session.Call(request); //出牌错误提示 LandlordsGamerPanelComponent gamerUI = LandRoomComponent.LocalGamer.GetComponent <LandlordsGamerPanelComponent>(); if (response.Error == ErrorCode.ERR_PlayCardError) { gamerUI.SetPlayCardsError(); } }