public ArrayList getProgramFromPanel() { IComparer comparator = new YPosComparator (); commandsDrawn.Sort(comparator); ArrayList commandList = new ArrayList(); foreach(var b in commandsDrawn) { GameObject box = (GameObject) b; CommandBox commandBox = box.GetComponent<CommandBox>(); Command command = commandBox.command; commandList.Add(command); } return commandList; }
public void FixOrderOfBlocks() { IComparer comparator = new YPosComparator (); commandsDrawn.Sort(comparator); FixCommandsOrder(); }