Пример #1
0
    public void Open(bool basicSpell, int spellNumber)
    {
        gameObject.SetActive(true);
        basic  = basicSpell;
        number = spellNumber;
        // Get the old builder to set values on the new book
        ProjectileSpellBook book = null;

        if (basicSpell)
        {
            book = playerShoot.GetComponent <Shoot>().GetNonBasicSpell(0) as ProjectileSpellBook;
        }
        else
        {
            book = playerShoot.GetComponent <Shoot>().GetNonBasicSpell(1) as ProjectileSpellBook;
        }
        book.ReturnProj();
        ProjectileSpellBookBuilder builder = book.spellBuilder;

        uiStuff.spellGrid.SetGrid(builder.grid.GetGrid());
        // Set our builder to the new builder
        projSpellBookBuilder = new ProjectileSpellBookBuilder(ProjectileSpellBookBuilder.spellSource.player);

        // Clear and set the grid
        //uiStuff.spellGrid.ClearGrid ();
        projSpellBookBuilder.grid = uiStuff.spellGrid;

        if (SpellInterfaceOpened != null)
        {
            SpellInterfaceOpened(builder, projSpellBookBuilder, uiStuff.spellGrid);
        }
    }
Пример #2
0
    void OnDisable()
    {
        if (current_spell == null)
        {
            return;
        }
        ProjectileSpellBook book = (ProjectileSpellBook)current_spell;

        book.ReturnProj();
    }