public void CheckCanServeDish(VR_OrderSlipBehaviour _orderSlip = null, ChickenRice _chickenRiceOrder = null)
    {
        //get the index num of the empty space on the counter
        int indexNum = SpawnDishOnCounter.Instance.CheckCounterHasSpace(); //returns -1 if there is no space

        ChickenRice orderDetails;

        if (_orderSlip != null)
        {
            //get the details of the order indicated on the orderslip
            orderDetails = _orderSlip.OrderSlipOrder;
        }
        else if (_chickenRiceOrder != null)
        {
            orderDetails = _chickenRiceOrder;
        }
        else
        {
            Debug.Log("Please pass an order slip into this function");
            return;
        }


        if (indexNum > -1) // if there is space on the counter, remove the order slip and spawn the dish
        {
            SpawnDishOnCounter.Instance.ServerSpawnDish(indexNum, orderDetails.RoastedChic, orderDetails.RicePlain, orderDetails.HaveEgg);

            RemoveOrderSlip(orderDetails);
        }
        else //if the serve counter is full, give feedback
        {
            Debug.Log("Service counter is too full to spawn dish");
        }
    }
Esempio n. 2
0
    private void OnTriggerEnter(Collider other)
    {
        VR_OrderSlipBehaviour orderSlipBehaviour = other.gameObject.GetComponent <VR_OrderSlipBehaviour>();

        if (orderSlipBehaviour != null)
        {
            if (CheckCounterHasSpace())
            {
                CounterFeedback(CheckCounterHasSpace());

                // if there is space on the counter, remove the order slip and spawn the dish
                if (indexNum > -1)
                {
                    //SpawnDishOnCounter_NotNetworked.Instance.SpawnDish(indexNum, orderSlipBehaviour.OrderSlipOrder.RoastedChic, orderSlipBehaviour.OrderSlipOrder.RicePlain, orderSlipBehaviour.OrderSlipOrder.HaveEgg);
                    SpawnDishOnCounter.Instance.ServerSpawnDish(indexNum, orderSlipBehaviour.OrderSlipOrder.RoastedChic, orderSlipBehaviour.OrderSlipOrder.RicePlain, orderSlipBehaviour.OrderSlipOrder.HaveEgg);

                    OrderSlipManagerScript.RemoveOrderSlip(orderSlipBehaviour);

                    DishBehaviourScript.ClearDishAfterServing();
                }
                else //if the serve counter is full, give feedback
                {
                    Debug.Log("Service counter is too full to spawn dish");
                }
            }
            else
            {
            }
        }
    }
    private void OnTriggerEnter(Collider other)
    {
        Debug.Log("on trigger enter: " + other.gameObject.name);
        if (other.gameObject.CompareTag(PlateableTag) && plateOccupiedBy == null)
        {
            VR_OrderSlipBehaviour   orderSlipBehaviour   = other.gameObject.GetComponent <VR_OrderSlipBehaviour>();
            VR_IngredientProperties ingredientProperties = other.gameObject.GetComponent <VR_IngredientProperties>();

            if (orderSlipBehaviour != null)
            {
                plateOccupiedBy = other.gameObject;

                if (DishEvaluationScript.CheckCorrespondingOrderSlip(orderSlipBehaviour.OrderSlipOrder) || isDebug)
                {
                    ToggleServingTrigger(true);
                    DishFeedbackScript.CorrectDish();
                }
            }
            else if (ingredientProperties != null)
            {
                plateOccupiedBy = other.gameObject;

                PlateIngredientTrigger.SetActive(true);
            }
        }
    }
Esempio n. 4
0
    //removes the order slip from the the currentlyDisplayedOrders list and hides its gameobj
    //then, it checks for hidden orders to display
    public void RemoveOrderSlip(VR_OrderSlipBehaviour orderSlip)
    {
        Debug.Log("remove order slip called");

        //disable the orderSlip
        orderSlip.gameObject.SetActive(false);

        //remove the order from the order slip list
        currentlyDisplayedOrders.Remove(orderSlip.OrderSlipOrder);
        orderSlip.ResetOrderSlip();

        //display a hidden order (if any)
        CheckAndDisplayHiddenOrders();
    }
    //-----------------------------------------------------------------SERVING AN ORDER-----------------------------------------------------------------------
    //method to serve the dish that the order slip is being placed on

    /*
     * public void CheckCanServeDish(VR_OrderSlipBehaviour _orderSlip)
     * {
     *  ChickenRice orderDetails = _orderSlip.OrderSlipOrder;
     *
     *  //get the index num of the empty space on the counter
     *  int indexNum = SpawnDishOnCounter.Instance.CheckCounterHasSpace(); //returns -1 if there is no space
     *
     *  // if there is space on the counter, remove the order slip and spawn the dish
     *  if (indexNum > -1)
     *  {
     *      SpawnDishOnCounter.Instance.SpawnDish(indexNum, orderDetails.RoastedChic, orderDetails.RicePlain, orderDetails.HaveEgg);
     *
     *      RemoveOrderSlip(_orderSlip);
     *  }
     *  else //if the serve counter is full, give feedback
     *  {
     *      Debug.Log("Service counter is too full to spawn dish");
     *  }
     *
     * }*/


    //removes the order slip from the the currentlyDisplayedOrders list and hides its gameobj
    //then, it checks for hidden orders to display
    public void RemoveOrderSlip(VR_OrderSlipBehaviour orderSlip)
    {
        Debug.Log("remove order slip called");

        //remove the order from the order slip list
        currentlyDisplayedOrders.Remove(orderSlip.OrderSlipOrder);

        orderSlip.StopChangingBackgroundColor();
        orderSlip.ToggleColliderAndVisuals(false);
        orderSlip.ResetOrderSlip();

        //display a hidden order (if any)
        CheckAndDisplayHiddenOrders();
    }
Esempio n. 6
0
    //-----------------------------------------------------------------SERVING AN ORDER-----------------------------------------------------------------------
    //method to serve the dish that the order slip is being placed on
    public void CheckCanServeDish(VR_OrderSlipBehaviour _orderSlip)
    {
        ChickenRice orderDetails = _orderSlip.OrderSlipOrder;

        //get the index num of the empty space on the counter
        int indexNum = SpawnDishOnCounter.Instance.CheckCounterHasSpace(); //returns -1 if there is no space

        // if there is space on the counter, remove the order slip and spawn the dish
        if (indexNum > -1)
        {
            //SpawnDishOnCounter.Instance.SpawnDish(indexNum, orderDetails.RoastedChic, orderDetails.RicePlain, orderDetails.HaveEgg);

            RemoveOrderSlip(_orderSlip);
        }
        else //if the serve counter is full, give feedback
        {
            Debug.Log("Service counter is too full to spawn dish");
        }
    }
    private void OnTriggerExit(Collider other)
    {
        if (other.gameObject == plateOccupiedBy)
        {
            VR_OrderSlipBehaviour   orderSlipBehaviour   = other.gameObject.GetComponent <VR_OrderSlipBehaviour>();
            VR_IngredientProperties ingredientProperties = other.gameObject.GetComponent <VR_IngredientProperties>();

            if (orderSlipBehaviour != null)
            {
                ToggleServingTrigger(false);
            }
            else if (ingredientProperties != null)
            {
                TogglePlatingTrigger(false);
            }

            plateOccupiedBy = null;
        }
    }