public void OnScrambleClick()
    {
        if (!isPaused)
        {
            isPaused = true;
        }

        StopAllCoroutines();

        ct.MakeUnscrambled(true);
        CubeSolver.Reset();

        StartCoroutine(ScrambleCube());
    }
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));
    }