Exemplo n.º 1
0
    public void Start()
    {
        menuLibrary       = LibraryManager.instance.get <MenuLibrary>();
        ingredientLibrary = LibraryManager.instance.get <IngredientLibrary>();
        if (ingredientOverridePool.Count > 0)
        {
            ingredientsPool = ingredientOverridePool;
        }
        else
        {
            ingredientsPool = menuLibrary.getIngredients().Select((ingred) => ingred.type).ToList();
        }

        foreach (IngredientType type in ingredientsPool)
        {
            ingredientsNotInUse.Add(type);
        }

        for (int a = 0; a < size; a++)
        {
            GameObject selector = Instantiate(ingredientSelector);
            selector.transform.SetParent(transform, false);
            setIngredientType(selector.GetComponent <IngredientHolder>(), getRandomIngredient());
            selectors.Add(selector.GetComponent <IngredientHolder>());
        }

        foreach (IngredientHolder ingredientHolder in selectors)
        {
            ingredientHolder.gameObject.GetComponent <OnEvent>().click += () => ingredientSelected(ingredientHolder);
        }
        ingredientSelected(selectors[0]);
    }
Exemplo n.º 2
0
    void Start()
    {
        customerLibrary   = GetComponent <CustomerLibrary>();
        ingredientLibrary = GetComponent <IngredientLibrary>();

        if (customerLibrary.IsValid() && ingredientLibrary.IsValid())
        {
            CustomerArrives();
        }
        else
        {
            QuitGame();
        }
    }
Exemplo n.º 3
0
 public void Start()
 {
     ingredientLibrary = LibraryManager.instance.get <IngredientLibrary>();
     setIngredient(ingredientLibrary.get(IngredientType.BasicBlue));
 }
Exemplo n.º 4
0
    public List <Ingredient> getIngredients()
    {
        IngredientLibrary ingredientLibrary = LibraryManager.instance.get <IngredientLibrary>();

        return(ingredients.Select(i => i != null ? ingredientLibrary.get((IngredientType)i) : null).ToList());
    }