Beispiel #1
0
    private void TakeIngredient(GameObject target)
    {
        IngredientID id = target.GetComponent <IngredientInfo>().id;

        //Debug.Log("picked up ingredient of type: " + id);
        managePlayerData.updateIngredients(id, true);
        //Destroy(target);
    }
Beispiel #2
0
    //called on press of menu button
    //removes selected item from the player and adds it to the pot
    void MenuButtonPressed(int index, ManagePlayerData managePlayerData)
    {
        //Debug.Log("Pressed button: " + ((IngredientID)index).ToString());
        managePlayerData.updateIngredients((IngredientID)index, false); //remove item from players inventory
        CookFood cookFood = gameObject.GetComponent <CookFood>();

        cookFood.AddIngredient((IngredientID)index); //add item to pot

        //remove menu and set displaying menu to false
        Destroy(newCanvas);
        displayingMenu = false;
        player.GetComponent <FirstPersonAIO>().ControllerPause();
    }