コード例 #1
0
ファイル: Card.cs プロジェクト: adam-binks/Space-Race
    void ChargeUntargeted()
    {
        if (status == CardStatus.InHand)
        {
            Debug.LogError("Cannot charge a card in hand!", this);
            return;
        }

        SetIsCharged(true);

        PlayerFunds funds = (template.authorPlayer == gm.localPlayerNum) ? gm.myFunds : gm.enemyFunds;

        funds.deductFromFunds(template.chargeCost);
    }
コード例 #2
0
ファイル: Card.cs プロジェクト: adam-binks/Space-Race
    /// Called by PlayCardAction
    public void AddToCardSlot(CardSlot cardSlot)
    {
        // parent to the card slot and move to it
        this.transform.SetParent(cardSlot.transform);
        this.transform.DOLocalMove(Vector2.zero, 0.1f);

        cardSlot.AddCard(this);
        hand.RemoveFromHand(this);
        status = CardStatus.OnBoard;

        PlayerFunds funds = (template.authorPlayer == gm.localPlayerNum) ? gm.myFunds : gm.enemyFunds;

        funds.deductFromFunds(template.playCost);

        UpdateTargetingGroupForChargeability();
        mouseDraggable.isDraggable = false;         // disable dragging

        sortingLayerManager.SetSortingLayer("CardInCardSlot");
    }