예제 #1
0
        public Meal prepare()
        {
            FryingPan utensil = new FryingPan();
            Pepper    spice   = new Pepper();

            // now do whatever steps are needed to prepare the meal...
            return(new Meal());
        }
예제 #2
0
    public void SetCurrentPan(FryingPan fryingPan)
    {
        currentPan = fryingPan;
        GetComponent <PancakeFlip>().SetFryingPan(currentPan);

        if (fryingPan != null)
        {
            SendMessage("SetDirectionTransform", fryingPan.transform);
        }
    }
예제 #3
0
    public void SetFryingPan(FryingPan pan)
    {
        fryingPan = pan;

        // reset the velocity when entering in the frying pan
        // TODO: maybe we could make this a lil more dynamic
        if (pan != null)
        {
            //velocity = Vector3.zero;

            force = forceY = 0;
        }
    }
예제 #4
0
    public void InitializeLumpiaMinigame(GameManager gameManager)
    {
        _gameManager = gameManager;
        gamePlayCamera.gameObject.SetActive(false);

        lumpiaCombos = new List <LumpiaCombo>();
        CreateCombos();

        plate = FindObjectOfType <Plate>();
        if (plate)
        {
            plate.InitializePlate(_gameManager);
        }

        rightHand = FindObjectOfType <PlayerHand>();
        if (rightHand)
        {
            rightHand.InitializePlayerHand(_gameManager);
        }


        fryingPan = FindObjectOfType <FryingPan>();

        if (fryingPan)
        {
            fryingPan.InitializeFryingPan(_gameManager);
        }

        Physics.IgnoreLayerCollision(LayerMask.NameToLayer("Food"), LayerMask.NameToLayer("Vegetable"));
        Physics.IgnoreLayerCollision(LayerMask.NameToLayer("Food"), LayerMask.NameToLayer("Meat"));
        Physics.IgnoreLayerCollision(LayerMask.NameToLayer("Food"), LayerMask.NameToLayer("Shrimp"));
        Physics.IgnoreLayerCollision(LayerMask.NameToLayer("Food"), LayerMask.NameToLayer("Wrapper"));

        lumpiaMinigameUserInterface = FindObjectOfType <LumpiaMinigameUserInterface>();
        if (lumpiaMinigameUserInterface)
        {
            lumpiaMinigameUserInterface.InitializeLumpiaMinigameUserInterface(_gameManager);
        }

        _gameManager.GetPlayer().playerInput.OnLookEvent += OnLookEventCalled;
        _gameManager.GetPlayer().playerInput.OnActionKeyPressedEvent += OnActionKeyPressedCalled;
    }
예제 #5
0
    /// <summary>
    /// 触れている調理器具からスクリプト取得
    /// </summary>
    /// <param name="obj"></param>
    private void ChangeTouchCookware(GameObject obj)
    {
        if (obj == _TouchCookware)
        {
            return;
        }

        _TouchCookware = obj;

        if (b_TouchPot)
        {
            _TouchPotScript = _TouchCookware.GetComponent <Pot>();
        }
        if (b_TouchFPan)
        {
            _TouchFryingPanScript = _TouchCookware.GetComponent <FryingPan>();
        }
        if (b_TouchCB)
        {
            _TouchCutScript = _TouchCookware.GetComponent <CuttingBoard>();
        }
    }
예제 #6
0
 public BakingStopEvent(FryingPan pan, BakableFood food) : base(pan)
 {
     this.pan  = pan;
     this.food = food;
 }
    // MOST OF THE INTERACTIONS HAPPEN HERE!! -----------------
    // while you are colliding with an item
    private void OnTriggerStay(Collider other)
    {
        //Debug.Log("PlayerAction is colliding with" + other.name);

        // collision with crates -----------------------------------
        if (other.gameObject.CompareTag("Crate"))
        {
            Crate crate = other.gameObject.GetComponent <Crate>();

            // if the player doesn't have an item and presses "J"
            if (!hasItem && Input.GetKeyDown(KeyCode.J))
            {
                // set item to the item from the crate
                SetItem(crate.ReturnItem());
            }
        }



        // using cutting board ---------------------------------------
        if (other.gameObject.CompareTag("CuttingBoard"))
        {
            CuttingBoard cuttingBoard = other.gameObject.GetComponent <CuttingBoard>();
            // if you have an item and the cutting board does not
            // OR
            // if you don't have an item but the cutting board does
            // AND
            // you're pressing down the "K" key
            if (hasItem && !cuttingBoard.hasItem && Input.GetKey(KeyCode.K) && currentItem.gameObject.CompareTag("FoodChoppable"))
            {
                Debug.Log("CURRENT ITEM NUMBER: " + currentItem.name);
                // give away item
                cuttingBoard.TakeInItem(currentItem);
                RemoveItem();
            }

            else if (!hasItem && cuttingBoard.hasItem && Input.GetKey(KeyCode.K))
            {
                // while the cutting is not done,
                if (!cuttingBoard.isCuttingDone)
                {
                    // cut
                    cuttingBoard.Cutting();
                    isChopping = true;
                }
            }

            if (!hasItem && cuttingBoard.isCuttingDone && Input.GetKeyDown(KeyCode.J))
            {
                SetItem(cuttingBoard.ReturnCuttedItem());
                cuttingBoard.ClearCuttingBoard();
            }
        }


        // Cooking with the Frying Pan -------------------------------------
        if (other.gameObject.CompareTag("FryingPan"))
        {
            FryingPan fryingPan = other.gameObject.GetComponent <FryingPan>();
            // if you have an item that can be cooked and the fryingPan is
            if (hasItem && !fryingPan.hasItem && Input.GetKeyDown(KeyCode.K) && currentItem.gameObject.CompareTag("FoodCookable"))
            {
                fryingPan.TakeInitem(currentItem);
                RemoveItem();
                fryingPan.CookFood();
            }

            if (!hasItem && fryingPan.isCooked && Input.GetKeyDown(KeyCode.J))
            {
                SetItem(fryingPan.ReturnCookedItem());
                fryingPan.ClearFryingPan();
            }
        }

        // Plate ----------------------------------------------------
        if (other.gameObject.CompareTag("Plate"))
        {
            Plate plate = other.gameObject.GetComponent <Plate>();
            // add item to plate
            if (hasItem && Input.GetKeyDown(KeyCode.K) && !currentItem.gameObject.CompareTag("Plate"))
            {
                plate.AddToPlate(currentItem);
                RemoveItem();
            }

            // pick up plate
            if (!hasItem && Input.GetKeyDown(KeyCode.J))
            {
                SetItem(plate.gameObject.GetComponent <Item>());
            }
        }

        // Service Window --------------------
        if (other.gameObject.CompareTag("ServiceWindow"))
        {
            ServiceWindow serviceWindow = other.gameObject.GetComponent <ServiceWindow>();

            if (hasItem && Input.GetKeyDown(KeyCode.K) && currentItem.gameObject.CompareTag("Plate"))
            {
                serviceWindow.GivePlateToWindow(currentItem.GetComponent <Plate>());
                // change plate position to x: -1     y: 3.3     z: -27
                RemoveItem();
            }
        }

        // Trash ----------------------------
        if (other.gameObject.CompareTag("Trash"))
        {
            Trash trash = other.gameObject.GetComponent <Trash>();



            if (hasItem && Input.GetKeyDown(KeyCode.K))
            {
                string tag = currentItem.gameObject.tag;
                trash.RemoveItem(currentItem);
                RemoveItem();
                if (tag == "Plate")
                {
                    CreateNewPlate();
                }
            }
        }
    }
예제 #8
0
        public void Ensure_that_you_cannot_fill_a_frying_pan_with_beer()
        {
            Avatar avatar = new Avatar();
            FryingPan pan = new FryingPan();
            avatar.PickUp(pan);

            Fridge fridge = new Fridge();
            avatar.DispenseBeerFrom(fridge).Into(pan);
        }