Beispiel #1
0
 public void Awake()
 {
     gameController          = GameController.Instance();
     createSavedButtonScript = FindObjectOfType <CreateSavedRecipeButtons>();
     cameraScript            = FindObjectOfType <CameraMovement>();
     voiceScript             = FindObjectOfType <VoicePacks>();
 }
Beispiel #2
0
    //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();
    }
Beispiel #3
0
    public void OpenAddDishPanel()
    {
        addDishPanel.gameObject.SetActive(true);
        CreateSavedRecipeButtons buttonMananger = addDishPanel.GetComponentInChildren <CreateSavedRecipeButtons>();

        buttonMananger.ClearContent();
        buttonMananger.CreateBuildingReferences();

        //play sounds?
        AudioManager.GetComponent <AudioManager>().PlayMenuSelectMid();
    }