Example #1
0
    private void OnTriggerEnter(Collider other)
    {
        if (other.tag == "customer")
        {
            var customer = other.gameObject.GetComponent <AICustomer>();
            switch (customer.myStatus)
            {
            case CustomerStatus.Eating:
                myScore -= 1;
                break;

            case CustomerStatus.Ordering:
                myScore += 5;
                customer.OrderComplete();
                break;
            }

            uiPlayer.SetScore(myScore);
        }
    }