Exemplo n.º 1
0
    void DisplaySpellDescription(GameObject spellButton)
    {
        ScriptableSpellReader mySpellScriptableReader = spellButton.GetComponent <ScriptableSpellReader>();

        spellDescriptionText.text = mySpellScriptableReader.spellName + "\n \n" +
                                    "Player Damage: " + mySpellScriptableReader.playerDamage + "\n \n" +
                                    "Spell Description: \n" + mySpellScriptableReader.spellDescriptionFromBook;
    }
Exemplo n.º 2
0
    public void ConfirmChosenSpell()
    {
        bool alreadyKnowsSpell = false;

        foreach (Button spellChoice in spellChoiceSelections)
        {
            spellChoice.interactable = true;
        }

        foreach (Button slot in spellSlots)
        {
            if (slot.GetComponentInChildren <Text>().text == chosenSpell)
            {
                alreadyKnowsSpell = true;
            }
        }

        //Debug.Log(alreadyKnowsSpell);

        if (!alreadyKnowsSpell)
        {
            ScriptableSpellReader spellReader = lastSpellSlotClicked.GetComponent <ScriptableSpellReader>();
            spellReader.mySpellScriptable = mySpellScriptable;
            spellReader.InitializeSpell();
            lastSpellSlotClicked.GetComponentInChildren <Text>().text = spellReader.spellName;

            GetComponent <CreationSceneManager>().CloseNewUIWindow(spellChoiceBG);
        }
        else
        {
            if (alreadyKnowsSpell)
            {
                GetComponent <CreationSceneManager>().CloseNewUIWindow(spellChoiceBG);
            }
        }
    }