public void Start()
 {
     distance                = 0;
     difficulty              = 0;
     lastCreateDistanceType  = ECreateDistance.NONE;
     lastCreateDistanceCount = 0;
 }
    private void CreateByDistance()
    {
        var type = ECreateDistance.NONE;

        do
        {
            type = (ECreateDistance)MathKit.RandomType(CREATE_DISTANCE_PROBS);
            if (type == lastCreateDistanceType)
            {
                ++lastCreateDistanceCount;
            }
            else
            {
                lastCreateDistanceType  = type;
                lastCreateDistanceCount = 1;
            }
        } while (lastCreateDistanceCount > 2);

        switch (type)
        {
        case ECreateDistance.ENEMY:
            CreateBarrier();
            break;

        case ECreateDistance.BARRIER:
            CreateBarrier();
            break;

        case ECreateDistance.ROLLING:
            CreateBarrier();
            break;

        default:
            break;
        }
    }