Esempio n. 1
0
    private GameObject MakePhysicalCard(string card)
    {
        // Find the actual card by the given name
        CardData data = DataLibrary.LoadCardFromString(card);

        GameObject    newCard   = Instantiate(CardPrefab, Vector3.zero, Quaternion.identity) as GameObject;
        CardBehaviour behaviour = newCard.GetComponent <CardBehaviour>();

        behaviour.SetCard(data);

        return(newCard);
    }
Esempio n. 2
0
    public void RemoteAddCard(int cardId, Player player)
    {
        print("remote");

        GameObject g = Instantiate(Resources.Load <GameObject>("Prefabs/CardObject"));

        g.transform.parent = transform;
        CardBehaviour cardBehaviour = g.GetComponent <CardBehaviour>();

        cardBehaviour.SetOwner(player);
        cardBehaviour.SetCard(CardDatabase.Instance.GetCardWithID(cardId));

        AddCard(cardBehaviour);
    }