Exemplo n.º 1
0
    public GameObject ShowCardPreview(Card card, CardInfo cardInfo, string previewObjName = "Canvas/CardPreview")
    {
        if (previewObjName == "Canvas/CardPreview")
        {
            previewObj = GameObject.Find(previewObjName);
        }

        GameObject curr = Instantiate(Resources.Load <GameObject>("Prefabs/Card"));

        curr.transform.SetParent(previewObj.transform, false);
        curr.transform.localScale = new Vector3(1.4f, 1.4f, 1);

        CardLogic cl = curr.GetComponent <CardLogic>();

        cl.enabled = false;

        CardVisuals cv = curr.GetComponent <CardVisuals>();

        cv.LoadCard(card);

        //if (cardInfo.doubleCast)
        //    cv.descObj.text = card.desc + " (DOUBLECAST)";

        if (cardInfo.exhausted)
        {
            cv.titleObj.text = card.title + " (EXHAUSTED)";
        }

        return(curr);
    }
Exemplo n.º 2
0
    public void DrawHandCards(int num = 2)
    {
        if (!photonView.IsMine)
        {
            return;
        }

        for (int i = 0; i < num; ++i)
        {
            GameObject curr = Instantiate(Resources.Load <GameObject>("Prefabs/Card"));
            curr.transform.SetParent(myHand.transform, false);

            CardLogic cl = curr.GetComponent <CardLogic>();
            cl.card     = playerDeckCards[0].First;
            cl.cardInfo = playerDeckCards[0].Second;

            CardVisuals cv = curr.GetComponent <CardVisuals>();
            cv.LoadCard(cl.card);
            //if (cl.cardInfo.doubleCast)
            //    cv.descObj.text = cl.card.desc + " (DOUBLECAST)";

            if (cl.cardInfo.exhausted)
            {
                cv.titleObj.text = cl.card.title + " (EXHAUSTED)";
            }

            playerDeckCards.Remove(playerDeckCards[0]);
        }
    }
Exemplo n.º 3
0
    private void Start()
    {
        player1   = GameObject.Find("Player1").GetComponent <PlayerManager>();
        player2   = GameObject.Find("Player2").GetComponent <PlayerManager>();
        caePrefab = Resources.Load <CardActionExecutor>("Prefabs/CardActionExecutor");

        cardVisuals     = GetComponent <CardVisuals>();
        realResolveCost = card.resolveCost;
        cardCostHandler = card.cardCostHandler;
        if (cardCostHandler != null)
        {
            StartCoroutine(cardCostHandler.StartChecking(CurrentPlayer(), this));
        }
    }
Exemplo n.º 4
0
    public void ATPCRPC(string title, string desc, string flavor, int resolveCost)
    {
        GameObject curr = Instantiate(Resources.Load <GameObject>("Prefabs/Card"));

        curr.transform.SetParent(playedCardPreview.transform, false);
        curr.transform.localScale = new Vector3(1.6f, 1.6f, 1);

        CardLogic cl = curr.GetComponent <CardLogic>();

        cl.enabled = false;

        CardVisuals cv = curr.GetComponent <CardVisuals>();

        cv.LoadCard(title, desc, flavor, resolveCost);
        StartCoroutine(PlayPCPAnim(curr));
    }
Exemplo n.º 5
0
 void Awake()
 {
     _cardVisuals = GetComponent <CardVisuals>();
 }