Пример #1
0
    //check that the order being served to them is correct
    public bool CheckOrder(GameObject servedFood)
    {
        //get current customer moood
        CustomerPatienceScript.CheckCustomerMood();
        OrderScript servedFoodScript = servedFood.GetComponent <OrderScript>();

        //Debug.Log("Checking if food served to customer is correct");

        if (servedFoodScript.DishLabel == customersOrder.ChickenRiceLabel)
        {
            //stop customer's patience meter
            TriggerPatienceMeter(false);


            //animate the customer eating
            EatingFood(servedFood, servedFoodScript);

            TriggerCustomerCollider(false, false);

            return(true);
        }
        else
        {
            WrongCustomer();

            return(false);
        }
    }
Пример #2
0
    public void TakeOrder(int next)
    {
        if (SceneManager.GetActiveScene().buildIndex != 0)
        {
            orderHandler = GameObject.FindGameObjectWithTag("OrderHandler").GetComponent <OrderScript> ();
        }

        if (orderHandler != null)
        {
            List <OrderScript.Order> tempOrderList = orderHandler.orderList;
            if (tempOrderList.Count > (0 + next))
            {
                //Remove the order from the list iff the path is generated successfully
                if (GeneratePathTo(tempOrderList [0 + next].x, tempOrderList [0 + next].y))
                {
                    OrderScript.Order o = tempOrderList [0 + next];
                    currentOrder = new OrderScript.Order(o.food, o.x, o.y, o.c, o.custID);
                    orderHandler.orderList.RemoveAt(0 + next);
                    orderTried = 0;
                }
                else
                {
                    orderTried++;
                    Debug.Log("Couldn't do it");
                }
            }
        }
    }
Пример #3
0
    public override void OnInspectorGUI()
    {
        DrawDefaultInspector();

        OrderScript orderScript = (OrderScript)target;

        if (GUILayout.Button("Order All Selected"))
        {
            orderScript.SelectGameObjects();
        }
    }
Пример #4
0
 void Start()
 {
     StartCoroutine(seatRandomCust());
     os = GameObject.FindGameObjectWithTag("OrderHandler").GetComponent <OrderScript> ();
     if (GameManager.day < 10)
     {
         dayText.text = "Day 0" + GameManager.day;
     }
     else
     {
         dayText.text = "Day " + GameManager.day;
     }
 }
Пример #5
0
    //customer has been served the right food and is eating it
    public void EatingFood(GameObject servedFood, OrderScript servedFoodScript)
    {
        //disable the order icon
        //orderIconPos.gameObject.SetActive(false);

        //move the dish from the player to the dishspawnpoint of the customer
        servedFoodScript.ToggleIcon(false);
        servedFood.transform.parent   = dishSpawnPoint;
        servedFood.transform.position = dishSpawnPoint.position;
        servedFood.layer = LayerMask.NameToLayer("UnInteractable"); //do not allow player to interact with the dish


        //enable eating animation
        //Debug.Log("Animating customer eating food");

        if (isServer)
        {
            RpcEatingFood();
        }
    }
Пример #6
0
    public void Write(OrderScript order)
    {
        infoText.text = null;
        var orderObj = order.Order;

        head.transform.GetComponent <Image>().sprite           = order.img;
        head.transform.Find("Name").GetComponent <Text>().text = "이름 : " + orderObj.orderName;

        if (orderObj as AttackScriptable != null)
        {
            var convert = orderObj as AttackScriptable;
            infoText.text += "기본 공격력 : " + convert.dmg.ToString() + "\n";
            infoText.text += "코스트 : " + convert.cost.ToString() + "\n";
            //나머지는 시각적으로 표현되니 넘어감
            infoText.text += "이미지내 타일\n 빨간타일 = 공격범위 \n 연두타일 = 시전위치 \n 주황타일 = 빨간타일 + 연두타일 \n 하늘타일 = 빨간타일 + 이동";
        }
        else
        {
        }
//        infoText.text +=
    }
Пример #7
0
 void Start()
 {
     orderScript = GameObject.Find("OrderPoint").GetComponent <OrderScript>();
 }
 private void Start()
 {
     this.mActor       = this.GetComponent <Character>();
     this.mRigidbody2D = this.GetComponent <Rigidbody2D>();
     tOrder            = CanvasScript.instance.order.GetComponent <OrderScript>();
 }