Beispiel #1
0
    public void Redraw()
    {
        List <Potion> potions = book.GetSorted();

        foreach (Transform t in container)
        {
            Destroy(t.gameObject);
        }

        for (int i = 0; i < recipesPerPage; i++)
        {
            int index = i + pageNumber * recipesPerPage;
            if (index >= potions.Count)
            {
                break;
            }
            Potion r = potions[index];

            RecipeRenderer newRenderer = Instantiate(recipeRendererPrefab, container).GetComponent <RecipeRenderer>();
            newRenderer.potion = r;
        }

        pageTextField.text = (pageNumber + 1).ToString();
    }