Example #1
0
    public void setState(CustomerStateDeprecated state)
    {
        if (state == _currentState)
        {
            return;
        }

        switch (state)
        {
        case CustomerStateDeprecated.WAITING_STAND:
            _moodDownSpeedCoeff = 1f;
            lastMoodChangeTime  = Time.time;
            break;

        case CustomerStateDeprecated.WAITING_SIT:
            placement.isFree    = true;
            _moodDownSpeedCoeff = 0.5f;
            lastMoodChangeTime  = Time.time;
            break;

        case CustomerStateDeprecated.MAKE_ORDER:
            collider.enabled = false;
            _sprite.Play("sit_happy");
            startOrderTime = Time.time;
            break;

        case CustomerStateDeprecated.EAT:
            _orderTable.hide();
            startEat = Time.time;
            _sprite.Play("sit_eat_drink");
            break;

        case CustomerStateDeprecated.WAITING_ORDER:

            // HACK
            _orderTable.gameObject.transform.position = gameObject.transform.position;
            _orderTable.gameObject.transform.Translate(0, 0, -2);

            Order ord = (Order)orders[0];
            _orderTable.show(ord.productID);

            _moodDownSpeedCoeff = 0.5f;
            lastMoodChangeTime  = Time.time;
            break;

        case CustomerStateDeprecated.HAPPY_OUT:
            _sprite.Play("hello");

            seatPosition.isFree = true;
            Destroy(gameObject, 2);
            break;

        default:
            Logger.message(LogLevel.LOG_ERROR, "Unknown customer state - " + state);
            break;
        }

        _currentState = state;
    }