Esempio n. 1
0
    private void AssignButtons()
    {
        root.Q <Button>("PreviousButton").clicked += () =>
        {
            favoritesCoffeesController.SwitchToPreviousFavoriteCoffee();
            RefreshView();
        };

        root.Q <Button>("NextButton").clicked += () =>
        {
            favoritesCoffeesController.SwitchToNextFavoriteCoffee();
            RefreshView();
        };

        addCoffeeButton          = root.Q <Button>("AddFavCoffee");
        addCoffeeButton.clicked += () =>
        {
            favoritesCoffeesController.AddFavoriteCoffee(nameField.value, waterField.value, coffeeField.value);
            RefreshView();
        };

        removeCoffeeButton          = root.Q <Button>("RemoveFavCoffee");
        removeCoffeeButton.clicked += () =>
        {
            favoritesCoffeesController.RemoveCurrentCoffee();
            RefreshView();
        };
    }
Esempio n. 2
0
 public void OnAddFavoriteCoffeePressed()
 {
     favoritesCoffeesController.AddFavoriteCoffee(favoriteCoffeeName.text,
                                                  float.Parse(amountOfWater.text), float.Parse(amountOfCoffee.text));
     RefreshView();
 }