Exemplo n.º 1
0
        public void SelectPlate(int position)
        {
            m_PlateIndex = position;

            FoodPlate selectedPlate = availablePlates[m_PlateIndex];

            //Assigns random ingredients to cook for each interactable
            int ingredientsQuantity = selectedPlate.ingredients.Length, index = Random.Range(0, ingredientsQuantity);

            foreach (CookingQTEInteractable cookingQteInteractable in cookingQteInteractables)
            {
                cookingQteInteractable.ingredientToCook = selectedPlate.ingredients[index];
                index.ChangeValueLimited(1, ingredientsQuantity);
            }

            GUIManager.Instance.CloseGUIMenu();
        }
 public override UICarouselElement Setup(params object[] parameters)
 {
     if (parameters != null)
     {
         plate = parameters[0] as FoodPlate;
     }
     if (!plate)
     {
         return(this);
     }
     if (plateImage)
     {
         plateImage.sprite = plate.icon;
     }
     if (plateName)
     {
         plateName.text = plate.itemName;
     }
     return(this);
 }