//Scrambling eases in and out
 private void UpdateScrambleFPR(double d)
 {
     if (d < 1 / 7.0)
     {
         ct.SetRotationSpeedIndex(4);
     }
     else if (d < 2 / 7.0)
     {
         ct.SetRotationSpeedIndex(3);
     }
     else if (d < 3 / 7.0)
     {
         ct.SetRotationSpeedIndex(2);
     }
     else if (d < 4 / 7.0)
     {
         ct.SetRotationSpeedIndex(1);
     }
     else if (d < 5 / 7.0)
     {
         ct.SetRotationSpeedIndex(2);
     }
     else if (d < 6 / 7.0)
     {
         ct.SetRotationSpeedIndex(3);
     }
     else
     {
         ct.SetRotationSpeedIndex(4);
     }
 }
Beispiel #2
0
    private IEnumerator DoDemo(int n)
    {
        safeToStop = true;
        ct.SetBlocks(guides[n].Item2);
        ct.MakeUnscrambled(false);

        ct.SetRotationSpeedIndex(Random.Range(5, 8));

        yield return(new WaitForSeconds(3f));

        for (int i = 0; i < guides[n].Item3.Length; i++)
        {
            safeToStop          = false;
            ct.finishedRotation = false;

            ct.Rotate(guides[n].Item3[i]);

            yield return(new WaitUntil(() => ct.finishedRotation));

            safeToStop = true;
            yield return(new WaitForSeconds(0.25f));
        }
        safeToStop = true;
        yield return(new WaitForSeconds(3f));

        StartCoroutine(cr = DoDemo(n));
    }