// Start is called before the first frame update void Start() { //restaurant = new RestaurantClass(); //Button u = FindObjectOfType<UpdateButton>().GetComponent<Button>(); menuEntreeItem.Add(entree1); menuEntreeItem.Add(entree2); menuEntreeItem.Add(entree3); menuEntreeItem.Add(entree4); menuEntreeItem.Add(entree5); menuEntreeItem.Add(entree6); menuEntreeItem.Add(entree7); menuEntreeItem.Add(entree8); menuEntreeItem.Add(entree9); menuEntreeItem.Add(entree10); menuDrinkItem.Add(drink1); menuDrinkItem.Add(drink2); menuDrinkItem.Add(drink3); menuDrinkItem.Add(drink4); menuDrinkItem.Add(drink5); restaurant = FindObjectOfType <Restaurant_Script>(); userLog = FindObjectOfType <UserLog>(); updatePrices.onClick.AddListener(delegate(){ Debug.Log("Update prices works"); updateEntreePrices(); updateDrinkPrices(); }); }
// Start is called before the first frame update void Start() { currentEntreeBox = 0; currentDrinkBox = 100; Button b = FindObjectOfType <AddButton>().GetComponent <Button>(); Button d = FindObjectOfType <DeleteButton>().GetComponent <Button>(); Button u = FindObjectOfType <UpdateButton>().GetComponent <Button>(); AddButton add = FindObjectOfType <AddButton>(); menuButton = FindObjectOfType <MenuButtonController>(); menuListPrices = FindObjectOfType <MenuListPrices>(); restaurantMenu = new RestaurantFineDining(); restaurant = FindObjectOfType <Restaurant_Script>(); menu = FindObjectOfType <Menu>(); //Button listener for the add button b.onClick.AddListener(delegate() { ////Debug.Log("Current: "+currentEntreeBox+" textbox: "+textBoxNum); if (menuButton.getEntree() && !selectedString.Equals("")) { if (textBoxNum == currentEntreeBox) { GetComponent <Text>().text = selectedString; selectedItem = new MenuItemClass(selectedString); restaurant.addEntreeToMenu(selectedItem, currentEntreeBox); restaurant.entreePopularity(currentEntreeBox); restaurant.setItemIngredientsCost(selectedString, currentEntreeBox); } currentEntreeBox++; } else { if (textBoxNum == currentDrinkBox) { GetComponent <Text>().text = selectedString; selectedItem = new MenuItemClass(selectedString); restaurant.addDrinkToMenu(selectedItem, currentDrinkBox - 100); restaurant.drinkPopularity(currentDrinkBox - 100); restaurant.setItemDrinksCost(selectedString, currentDrinkBox - 100); } currentDrinkBox++; } }); //Button listener for the delete button d.onClick.AddListener(delegate(){ }); u.onClick.AddListener(delegate(){ menuListPrices.updateMenu(); //restaurantMenu.getEntreeMenu(); }); }
// Start is called before the first frame update void Start() { test = new Demographic(minPopulation, maxPopulation); restaurant = FindObjectOfType <Restaurant_Script>(); displayPopulation(test); displayHousehold(test); displayAdults(test); displayChildren(test); displayIncome(test); }
// Start is called before the first frame update void Start() { userLog = FindObjectOfType <UserLog>(); demo = FindObjectOfType <Demographics_Script>(); timer = 0; days = 0; monthChecker = 0; //limit = 7; simulateStarted = false; Debug.Log(simDropdown.value); text.text = "Day " + currentTime; restaurant = FindObjectOfType <Restaurant_Script>(); //Button listener on the simulate button that starts the time simulation b = GetComponent <Button>(); b.onClick.AddListener(delegate() { if (!simulateStarted) { buttonStop(b); userLog.logAction("User has started simulation"); userLog.displayRecentAction(); } else { buttonSim(b); userLog.logAction("User has stopped simulation after " + days + " days"); userLog.displayRecentAction(); } if (simDropdown.value == 0) { limit = 1; } else if (simDropdown.value == 1) { limit = 7; } else if (simDropdown.value == 2) { limit = 30; } else { limit = 7; } //On button press, toggles the simulation on and off //Days are set to 0 simulateStarted = !simulateStarted; days = 0; }); }
// Start is called before the first frame update void Start() { restaurant = FindObjectOfType <Restaurant_Script>(); results = restaurant.getResultsInfo(); displayText(); updateButton.onClick.AddListener(delegate(){ displayText(); }); }