Пример #1
0
    public void Setup(FoodObject currentFood, Canvas newCanvas, Bag bag, int indx)
    {
        food = currentFood;

        image.sprite      = Resources.Load <Sprite>(food.getIcon());
        quantityText.text = food.getQuantity().ToString();
        canvas            = newCanvas;
        bagScript         = bag;
        index             = indx;
        model             = food.getModel();
    }
Пример #2
0
    public void Setup(FoodObject currentFood, ShopScrollList currentScrollList)
    {
        food             = currentFood;
        nameLabel.text   = food.getName();
        priceLabel.text  = food.getPrice().ToString();
        iconImage.sprite = Resources.Load <Sprite>(food.getIcon());

        scrollList = currentScrollList;
        if (scrollList.isPlayer)
        {
            quantityLabel.text = "x" + food.getQuantity().ToString();
        }
        else
        {
            quantityLabel.text = "";             // blank
        }
    }
Пример #3
0
    private void RefreshPage(int pageNum)
    {
        Debug.Log("Currently on page #" + pageNum);

        FoodObject food = levelList[currentPage - 1];

        FoodNameLabel.text = food.getName();
        FoodImage.sprite   = Resources.Load <Sprite>(food.getIcon());

        foreach (GameObject obj in ingredientList)
        {
            Destroy(obj);
        }
        ingredientList.Clear();

        foreach (FoodObject ing in food.getIngNeeded())
        {
            GameObject newObj = Instantiate(ingInfo, ScrollViewContent);

            ingredientList.Add(newObj);

            IngredientInfo ingredientInfo = newObj.GetComponent <IngredientInfo>();
            ingredientInfo.Setup(ing);
        }

        if (currentPage == 1)
        {
            ButtonBackPage.interactable = false;
        }
        else
        {
            ButtonBackPage.interactable = true;
        }

        if (currentPage == maxPage)
        {
            ButtonNextPage.interactable = false;
        }
        else
        {
            ButtonNextPage.interactable = true;
        }
    }
Пример #4
0
 public void Setup(FoodObject currentFood)
 {
     nameLabel.text   = currentFood.getName() + " x" + currentFood.getQuantity().ToString();;
     iconImage.sprite = Resources.Load <Sprite>(currentFood.getIcon());
 }