public void Awake() { gameController = GameController.Instance(); createSavedButtonScript = FindObjectOfType <CreateSavedRecipeButtons>(); cameraScript = FindObjectOfType <CameraMovement>(); voiceScript = FindObjectOfType <VoicePacks>(); }
//Players menus are kept between players, they share one. //This only happens once public void OnClick() { bool addRecipe = true; for (int i = 0; i < thisRestaurant.recipes.Count; i++) { if (thisRestaurant.recipes[i].recipe == thisRecipe) { addRecipe = false; } } if (addRecipe) { thisRestaurant.recipes.Add(new RestaurantRecipe(thisRecipe)); } savedRecipeScript = gameObject.GetComponentInParent <CreateSavedRecipeButtons>(); Debug.Log("Name of the recipe I have right now is (Menu Add Button) " + thisRecipe.name); createMenuRecipeScript.FillBuildingRestaurant(); // Fills reference of Building Restruant if (addRecipe) { createMenuRecipeScript.CreateMenuButton(button, thisRecipe); // Creates the button and then adds it to the list of buttons and recipes } RecipeCost recipe = new RecipeCost(); }
public void OpenAddDishPanel() { addDishPanel.gameObject.SetActive(true); CreateSavedRecipeButtons buttonMananger = addDishPanel.GetComponentInChildren <CreateSavedRecipeButtons>(); buttonMananger.ClearContent(); buttonMananger.CreateBuildingReferences(); //play sounds? AudioManager.GetComponent <AudioManager>().PlayMenuSelectMid(); }