public void OnClick(RaycastHit hit, Transform t)
    {
        IInteract obj = interact.GetHolding();

        if (obj == null && !CookUI.isMoving && canInteract)
        {
            if (!gameObject.CompareTag("Tray")) //trays cannot be picked up, after some deliberartion
            {
                if (gameObject.CompareTag("Plate"))
                {
                    CheckPlateCount();
                }
                interact.OnPickUp(transform);
                CheckForFood();
            }
        }
        else if (obj != null && !CookUI.isMoving && canInteract)
        {
            if (obj.GetObject().CompareTag("Food") && !interact.Moving()) //putiing food on move_s
            {
                if (foodType != null)                                     //for trays
                {
                    if (foodType.name == obj.GetName())
                    {
                        PutFoodOn(hit, obj.GetObject());
                    }
                }
                else
                {
                    PutFoodOn(hit, obj.GetObject()); //doesn't need to distinguish between food types
                }
            }
        }
    }
Example #2
0
    public void OnClick(RaycastHit hit, Transform t)
    {
        IInteract inter = i.GetHolding();

        if (inter != null)
        {
            PlaceMarker m = null;

            if (gameObject.CompareTag("PShelf"))
            {
                m = i.ClosestMarker(pMarkers.ToArray(), hit.point);
            }
            else
            {
                m = i.ClosestMarker(markers, hit.point);
            }

            if (!m.GetOccupation())
            {
                if (inter.GetObject().CompareTag("Food"))
                {
                    PutFoodDown(inter.GetObject());
                }

                i.OnPutDown(m, null, false);
            }
        }
    }
Example #3
0
    public void OnClick(RaycastHit hit, Transform t)
    {
        IInteract obj = i.GetHolding();

        if (obj != null)
        {
            if (obj.GetObject().CompareTag("Plate") && ticket != null)
            {
                PlaceMarker m = i.ClosestMarker(markers, hit.point);
                if (!m.GetOccupation())
                {
                    SendMeal();
                    SetTicket(null);
                    i.OnPutDown(m, null, true);
                }
            }
        }
    }