示例#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);
    }
示例#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]);
        }
    }
示例#3
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));
    }