SequencerSectionModel checkSectionExistsOrCreate(string name, SequencerData data) { SequencerSectionModel sectionModel; if (data.sections.Count == 0) { sectionModel = new SequencerSectionModel(); sectionModel.name = name; sectionModel.commandList = new List<SequencerCommandBase>(); data.sections.Add(sectionModel); } else { sectionModel = data.getSectionModel(name); if (sectionModel.name != name) { sectionModel = new SequencerSectionModel(); sectionModel.name = name; sectionModel.commandList = new List<SequencerCommandBase>(); data.sections.Add(sectionModel); } } return sectionModel; }