Example #1
0
    public void loadCardDetails(GameObject cardDetails)
    {
        GameObject go = Instantiate(cardDetails, transform.transform);

        details           = go.GetComponent <CardDetails>();
        details.character = character;
        details.cardBase  = this;
        details.prefabRef = cardDetails;
        name = details.cardName;
        string subtypesKey = "";

        magicParticles.gameObject.SetActive(false);
        foreach (CardSubType type in details.subTypes)
        {
            string subType = type.ToString().ToLower();
            if (subType.Equals("magic"))
            {
                magicParticles.gameObject.SetActive(true);
            }
            else
            {
                subtypesKey += subType;
            }
        }
        cardMeshRenderer.material = MaterialDictionary.Instance().materialDictionary[subtypesKey];
        cardNameMesh.text         = details.cardName;
        energyPlayCostMesh.text   = details.getEnergyPlayCost().ToString();
        focusPlayCostMesh.text    = (details.getFocusPlayCost() > 0 ? details.getFocusPlayCost().ToString() : "");
        artSprite.sprite          = details.art;
        typelineMesh.text         = details.getTypeLine();
        focusLearnCostMesh.text   = details.getFocusLearnCost().ToString();
        resetCardInfo();
    }