Example #1
0
    void BlockHit(Block b)
    {
        lastAccuracy = accuracyCurve.Evaluate(1.0f - Mathf.Abs(optimalBlockHitLocation - b.transform.position.z) / optimalBlockHitLocation);
        sumAccuracy += lastAccuracy;

        score += Mathf.RoundToInt(lastAccuracy * 100) * multiplier;
        combo++;

        if (multiplier != 8 && combo % hitsToIncreaseMultiplier == 0)
        {
            multiplier *= 2;
        }

        StartCoroutine(visualization.ChangeTrackColor(Mathf.RoundToInt(b.transform.position.x), lastAccuracy));
        b.DestroyBlock(lastAccuracy);
        currentBlockNumber++;
    }