Пример #1
0
        void OnInputEnded(Vector2 startPosition, Vector2 position, float deltaTime)
        {
            var selectedCard = _selectedCard;

            _selectedCard = null;

            var ray = Camera.main.ScreenPointToRay(Input.mousePosition);

            if (Physics.Raycast(ray, out var hit, maxDistance: Mathf.Infinity, layerMask: 1 << 10))
            {
                for (var i = 0; i < Arena.Lanes.Length; ++i)
                {
                    var lane = Arena.Lanes[i];
                    if (lane.transform == hit.transform)
                    {
                        var card = selectedCard.Card;
                        selectedCard.Slot.RemoveCard();
                        OnUseCard?.Invoke(card, i);
                    }
                }
            }
        }
Пример #2
0
 private void UseCard(GamePlayer gamePlayer, CardRecord cardRecord)
 {
     gamePlayer.RemainedManaCrystal -= cardRecord.ManaCost;
     gamePlayer.RemoveHandCard(cardRecord.CardRecordID);
     OnUseCard?.Invoke(this, gamePlayer, cardRecord);
 }