public void AddStarter(LevelStarter ls) { int index = 0; Lines = new List <UILine>(); LineContainer = this.transform.GetChild(0); foreach (var loopInfo in ls.Loops) { UILoop loop = Instantiate(LoopPrefab, LineContainer); loop.Init(index++, true, loopInfo.End); Lines.Add(loop); foreach (var instruction in loopInfo.StarterInstructions) { UIStatement statement = Instantiate(StatementPrefab, LineContainer); statement.Init(index++, true, instruction); Lines.Add(statement); } for (int i = loopInfo.StarterInstructions.Count; i < loopInfo.MaxInstructions; i++) { UIBlankLine line = Instantiate(BlankLinePrefab, LineContainer); line.Init(index++, false); Lines.Add(line); } // insert empty line between loops index++; } UIExit exit = Instantiate(ExitPrefab, LineContainer); exit.Init(index++, true); Lines.Add(exit); }
public void AddStarter(LevelStarter ls) { }