Пример #1
0
 public void execute()
 {
     pivot_c.turn(side, direction);
     relevant = false;
 }
Пример #2
0
    void Update()
    {
        if (shuffle)
        {
            shuffleCube();
        }
        else if (!working)
        {
            if (solve)
            {
                solution.solveCube();
            }
            if (shortTest)
            {
                shortTest = false;
                setTask(new Task("right", 1));
                setTask(new Task("front", 1));
                setTask(new Task("up", 1));
                setTask(new Task("down", 1));
                solve = true;
            }
            if (longTest)
            {
                //rotationMagintude = 90;
                shuffleCube();
                if (long_test_num-- == 0)
                {
                    solve         = true;
                    longTest      = false;
                    long_test_num = Random.Range(15, 30);
                }
            }
            pivot_c.doTasks();
        }
        init();

        if (clockwise)
        {
            direction = 1;
        }
        else
        {
            direction = -1;
        }

        switch (action)
        {
        case 0:
            if (pivot_c.isDoingTask())
            {
                pivot_c.finishedTask();
            }
            break;

        case 1:
            if (!working)
            {
                working = true;
            }
            pivot_c.turn(axis, polarity, direction);
            break;
        }
    }