For the following code, I would like to shuffle rows (startpositions, cueobjects, and targetobjects). So the row doesn’t go from [0] to [1]; instead, it can go [6] then [8] etc. I was wondering if anyone knows a way of randomizing the list and then creates a list. Thanks!
For example,
From this
List<List<GameObject>> pairs = new List<List<GameObject>>()
{
new List<GameObject>{ taskInfo.StartPositions[0], taskInfo.CueObjects[0], taskInfo.TargetObjects[0]},
new List<GameObject>{ taskInfo.StartPositions[1], taskInfo.CueObjects[1], taskInfo.TargetObjects[1]},
new List<GameObject>{ taskInfo.StartPositions[2], taskInfo.CueObjects[2], taskInfo.TargetObjects[2]},
new List<GameObject>{ taskInfo.StartPositions[3], taskInfo.CueObjects[3], taskInfo.TargetObjects[3]},
new List<GameObject>{ taskInfo.StartPositions[4], taskInfo.CueObjects[4], taskInfo.TargetObjects[4]},
new List<GameObject>{ taskInfo.StartPositions[5], taskInfo.CueObjects[5], taskInfo.TargetObjects[5]},
new List<GameObject>{ taskInfo.StartPositions[6], taskInfo.CueObjects[6], taskInfo.TargetObjects[6]},
new List<GameObject>{ taskInfo.StartPositions[7], taskInfo.CueObjects[7], taskInfo.TargetObjects[7]},
new List<GameObject>{ taskInfo.StartPositions[8], taskInfo.CueObjects[8], taskInfo.TargetObjects[8]},
new List<GameObject>{ taskInfo.StartPositions[9], taskInfo.CueObjects[9], taskInfo.TargetObjects[9]},
};
To
List<List<GameObject>> pairs = new List<List<GameObject>>()
{
new List<GameObject>{ taskInfo.StartPositions[4], taskInfo.CueObjects[4], taskInfo.TargetObjects[4]};
new List<GameObject>{ taskInfo.StartPositions[0], taskInfo.CueObjects[0], taskInfo.TargetObjects[0]},
new List<GameObject>{ taskInfo.StartPositions[6], taskInfo.CueObjects[6], taskInfo.TargetObjects[6]},
new List<GameObject>{ taskInfo.StartPositions[1], taskInfo.CueObjects[1], taskInfo.TargetObjects[1]},
new List<GameObject>{ taskInfo.StartPositions[2], taskInfo.CueObjects[2], taskInfo.TargetObjects[2]},
new List<GameObject>{ taskInfo.StartPositions[3], taskInfo.CueObjects[3], taskInfo.TargetObjects[3]},
new List<GameObject>{ taskInfo.StartPositions[8], taskInfo.CueObjects[8], taskInfo.TargetObjects[8]},
new List<GameObject>{ taskInfo.StartPositions[9], taskInfo.CueObjects[9], taskInfo.TargetObjects[9]},
new List<GameObject>{ taskInfo.StartPositions[5], taskInfo.CueObjects[5], taskInfo.TargetObjects[5]},
new List<GameObject>{ taskInfo.StartPositions[7], taskInfo.CueObjects[7], taskInfo.TargetObjects[7]},
};