public void exec() { if (!executable) { return; } Cube cube = GameObject.Find("cube").GetComponent <Cube>(); cube.Back(); }
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(); } }
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(); } }