Ejemplo n.º 1
0
    public void exec()
    {
        if (!executable)
        {
            return;
        }
        Cube cube = GameObject.Find("cube").GetComponent <Cube>();

        cube.Back();
    }
Ejemplo n.º 2
0
        private static void ProcessCommand(Cube cube, Command command, int time)
        {
            switch (command)
            {
            case Command.Up:
                cube.Forward(time);
                break;

            case Command.Down:
                cube.Back(time);
                break;

            case Command.Left:
                cube.TurnLeft(time);
                break;

            case Command.Right:
                cube.TurnRight(time);
                break;

            default:
                throw new NotSupportedException();
            }
        }
Ejemplo n.º 3
0
        private static void ProcessCommand(Cube cube, Command command, int time)
        {
            switch (command)
            {
                case Command.Up:
                    cube.Forward(time);
                    break;

                case Command.Down:
                    cube.Back(time);
                    break;

                case Command.Left:
                    cube.TurnLeft(time);
                    break;

                case Command.Right:
                    cube.TurnRight(time);
                    break;

                default:
                    throw new NotSupportedException();
            }
        }