Пример #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();
        };
    }
Пример #2
0
 public void OnPreviousFavoriteCoffeePressed()
 {
     favoritesCoffeesController.SwitchToPreviousFavoriteCoffee();
     RefreshView();
 }