Ejemplo n.º 1
0
    public void RpcPlayToken(NetworkIdentity cardId, NetworkIdentity creatureId, CreatureType tokenType)
    {
        if (!isServer)
        {
            Card card = cardId.gameObject.GetComponent <Card>();
            card.cardData    = new CardInstance(GameUtils.GetCreatureModelIndex().GetToken(tokenType));
            card.owner       = this;
            card.controller  = this;
            card.isRevealed  = isLocalPlayer;
            card.isDraggable = isLocalPlayer;

            Creature creature = creatureId.gameObject.GetComponent <Creature>();
            creature.controller = this;
            creature.owner      = this;
            creature.SetCard(card);

            if (!arena.IsFull())
            {
                arena.AddCreature(creature);
            }
            else
            {
                discard.AddCreature(creature);
            }
        }
    }