Inheritance: MonoBehaviour
Ejemplo n.º 1
0
    // Update is called once per frame
    void Update()
    {
        if (waiting)
        {
            waitTime -= Time.deltaTime;
            if (waitTime <= 0)
            {
                timedOut = true;
            }
            else if (waitTime <= (waitDelay / 3))
            {
                animator.SetTrigger("angry");
            }
        }
        if (!sitting)
        {
            //print (UIControl.musicCheck);
            findSeat();
        }
        else if (!ordered)
        {
            transform.position = new Vector3(transform.position.x, transform.position.y, transform.position.z - 0.5f);
            placeOrder();
            waitTime = waitDelay;
            waiting = true;
            customerDO = Instantiate(diagOrder);
            customerDO.transform.position = new Vector3(transform.position.x + 1.5f, 3.7f, 1.25f);
            customerDO.drawOrder(ref myOrder);
        //            foreach (var item in myOrder) { total += gameManager.prices[item];}
        }
        else if (giveOrder && Input.GetMouseButtonUp(0))
        {
            //count++;

            if (myOrder.Contains(item.tag))
            {
                //print("giveorder tag: " + item.tag);
                myOrder.Remove(item.tag);
                waitTime += 5f;
                total += GameManager.prices[item.tag];
                world.moneyEarned += GameManager.prices[item.tag];
                //print("myorder count: " + myOrder.Count);
                Destroy(item.gameObject);
                customerDO.drawOrder(ref myOrder);
                giveOrder = false; // check this
            }
        }
        else if (World.done || 0 == myOrder.Count || timedOut)
        {
            if (!leaving) {
                leaving = true;
                transform.position = new Vector3(transform.position.x, transform.position.y, transform.position.z + 0.5f);
                if (customerDO != null)
                {
                    Destroy(customerDO.gameObject);
                }
        }
        /*            if (!paid)
            {
                 gameManager.money += total;
                paid = true;
            }
         * */
            leaveSeat();
        }
    }
Ejemplo n.º 2
0
    // Update is called once per frame
    void Update()
    {
        if (waiting)
        {
            waitTime -= Time.deltaTime;
            if (waitTime <= 0)
            {
                timedOut = true;
            }
            else if (waitTime <= (waitDelay / 3))
            {
                animator.SetTrigger("angry");
            }
        }
        if (!sitting)
        {
            //print (UIControl.musicCheck);
            findSeat();
        }
        else if (!ordered)
        {
            transform.position = new Vector3(transform.position.x, transform.position.y, transform.position.z - 0.5f);
            placeOrder();
            waitTime   = waitDelay;
            waiting    = true;
            customerDO = Instantiate(diagOrder);
            customerDO.transform.position = new Vector3(transform.position.x + 1.5f, 3.7f, 1.25f);
            customerDO.drawOrder(ref myOrder);
//            foreach (var item in myOrder) { total += gameManager.prices[item];}
        }
        else if (giveOrder && Input.GetMouseButtonUp(0))
        {
            //count++;

            if (myOrder.Contains(item.tag))
            {
                //print("giveorder tag: " + item.tag);
                myOrder.Remove(item.tag);
                waitTime          += 5f;
                total             += GameManager.prices[item.tag];
                world.moneyEarned += GameManager.prices[item.tag];
                //print("myorder count: " + myOrder.Count);
                Destroy(item.gameObject);
                customerDO.drawOrder(ref myOrder);
                giveOrder = false; // check this
            }
        }
        else if (World.done || 0 == myOrder.Count || timedOut)
        {
            if (!leaving)
            {
                leaving            = true;
                transform.position = new Vector3(transform.position.x, transform.position.y, transform.position.z + 0.5f);
                if (customerDO != null)
                {
                    Destroy(customerDO.gameObject);
                }
            }

/*            if (!paid)
 *          {
 *               gameManager.money += total;
 *              paid = true;
 *          }
 * */
            leaveSeat();
        }
    }