Пример #1
0
    // Update is called once per frame
    void FixedUpdate()
    {
        if (status.CurrentState == CarState.WORKING)
        {
            moveCar();
            checkObstacles();
            status.distanceToNextGasStation = checkDistanceToGasStation();

            var gas = status.consumeGas();
            if (gas <= 0)
            {
                finishGas();
            }
        }
    }