Beispiel #1
0
    public void SetOrder(Customer.CustomerRequest request, Action decline = null, Action accept = null)
    {
        _orderObject.gameObject.SetActive(true);

        ClearPreviewer();

        _orderObject.localPosition = _origin;
        _orderImage.color          = _corners[1].Color;

        foreach (var ingridient in request.Burger._ingridients)
        {
            if (ingridient is IEditable editable)
            {
                var obj = Instantiate(editable.GetTransform().gameObject);
                _previewer.GetData().AddIngridient(obj.GetComponent <IIngridient>());
            }
        }

        _priceText.text = request.Price + "$";

        _corners[0].OnObjectInCorner = decline;
        _corners[2].OnObjectInCorner = accept;

        _corners[0].OnObjectInCorner += Hide;
        _corners[2].OnObjectInCorner += Hide;
    }
Beispiel #2
0
    public Customer.CustomerRequest CreateRequest(ref BurgerData data, int scheduleNumber)
    {
        var burger = FillBurger(_difficultyPattern[_offset]);

        foreach (var ing in burger)
        {
            var spawnedIng = SpawnIngridient(ing);
            data.AddIngridient(spawnedIng);
        }

        Customer.CustomerRequest request = new Customer.CustomerRequest()
        {
            Burger = data,
            Price  = CalcPrice(scheduleNumber)
        };

        return(request);
    }