Exemple #1
0
 public void OnDisplayCard(CardDisplayRequest _evt)
 {
     //if (_evt.IsMatch( HandIndex, Index ))
     if (_evt.HandIndex == HandIndex && _evt.CardIndex == Index)
     {
         var spriteRequest = new CardSpriteRequest(_evt.CardId);
         Dispatcher.Default.Post(spriteRequest);
         if (CardImage.sprite != spriteRequest.Sprite)
         {
             CardImage.sprite = spriteRequest.Sprite;
             Debug.Log($"New card at [{HandIndex}][{Index}]");
         }
         else
         {
             Debug.Log($"Using cached card at [{HandIndex}][{Index}]");
         }
     }
 }
    public void ProvideSprite(CardSpriteRequest _req)
    {
        var cardId = _req.CardId;

        _req.Sprite = GetSprite(cardId);
    }