Exemple #1
0
 void PlayCard(LocationCardSceneObj card, LocationSlot slot)
 {
     Debug.Log("PLAY CARD");
     card.isWaitingToPlay = true;
     slot.card            = card;
     card.GetComponent <RectTransform>().position = Camera.main.WorldToScreenPoint(slot.gameObject.transform.position);
     EncounterController.instance.StartEncounter(card.card.encounter);
 }
Exemple #2
0
    void Start()
    {
        handWidth = handTransform.GetComponent <RectTransform>().rect.width - GameController.instance.locationCardPrefab.GetComponent <RectTransform>().rect.width;

        currentDeck = startingDeck;
        for (int cLoop = 0; cLoop < currentDeck.cards.Count; cLoop++)
        {
            GameObject           newCard = GameObject.Instantiate(GameController.instance.locationCardPrefab, handTransform);
            LocationCardSceneObj c       = newCard.GetComponent <LocationCardSceneObj>();
            RectTransform        rt      = c.GetComponent <RectTransform>();
            rt.position = startTransform.position;
            c.GetComponent <LocationCardSceneObj>().SetupCard(currentDeck.cards[cLoop]);
            cards.Add(c);
            c.SetHand(this);
        }

        UpdateDeckSizes();
    }