Greetings everyone, currently I am structuring my array in the following manner:
var piece1 = new DialoguePiece(null, questions[0], 0, 0, 4, 1);
var piece2 = new DialoguePiece(null, questions[1], 1, 0, 2, 3);
var piece3 = new DialoguePiece(scripts[1], null, 2, 1, 2, 2);
var piece4 = new DialoguePiece(scripts[2], null, 3, 1, 3, 3);
var piece5 = new DialoguePiece(scripts[0], null, 4, 0, 5, null);
var piece6 = new DialoguePiece(scripts[3], questions[2], 5, 4, 6, null);
var piece7 = new DialoguePiece(scripts[4], null, 6, 5, 7, null);
var piece8 = new DialoguePiece(scripts[5], null, 7, 6, null, null);
var pieces = [piece1,
piece2,
piece3,
piece4,
piece5,
piece6,
piece7,
piece8];
However, I am contemplating if there is a simpler approach to achieve this. For instance:
var pieces = GetObjectsByName(DialoguePiece);
Your insights would be greatly appreciated.