/// <summary> /// 提示 /// </summary> private async void OnPrompt() { Actor_GamerPrompt_Req request = new Actor_GamerPrompt_Req(); Actor_GamerPrompt_Back response = (Actor_GamerPrompt_Back)await SessionComponent.Instance.Session.Call(request); HandCardsComponent handCards = LandlordsRoomComponent.LocalGamer.GetComponent <HandCardsComponent>(); //清空当前选中 while (currentSelectCards.Count > 0) { Card selectCard = currentSelectCards[currentSelectCards.Count - 1]; handCards.GetSprite(selectCard).GetComponent <HandCardSprite>().OnClick(null); } //自动选中提示出牌 if (response.Cards != null) { for (int i = 0; i < response.Cards.Count; i++) { handCards.GetSprite(response.Cards[i]).GetComponent <HandCardSprite>().OnClick(null); } } }
/// <summary> /// 提示 /// </summary> private async void OnPrompt() { Actor_GamerPrompt_Req request = new Actor_GamerPrompt_Req(); Actor_GamerPrompt_Ack response = await SessionComponent.Instance.Session.Call(request) as Actor_GamerPrompt_Ack; GamerComponent gamerComponent = this.GetParent <UI>().GetParent <UI>().GetComponent <GamerComponent>(); HandCardsComponent handCards = gamerComponent.LocalGamer.GetComponent <HandCardsComponent>(); //清空当前选中 while (currentSelectCards.Count > 0) { Card selectCard = currentSelectCards[currentSelectCards.Count - 1]; handCards.GetSprite(selectCard).GetComponent <HandCardSprite>().OnClick(null); } //自动选中提示出牌 if (response.Cards != null) { for (int i = 0; i < response.Cards.Length; i++) { handCards.GetSprite(response.Cards[i]).GetComponent <HandCardSprite>().OnClick(null); } } }