// Use this for initialization void Start() { foreach (var instrument in InstrumentHelper.GetInstrumentList()) { var row = GetRowForInstrument(instrument); row.Init(InstrumentHelper.GetColorForInstrument(instrument)); } }
public void Init(MeasureConfig config) { _rectTransform = (RectTransform)this.transform; _rowList = new List <Row>(); var instrumentList = InstrumentHelper.GetInstrumentList(); foreach (var instrument in instrumentList) { List <NoteConfig> noteList; if (!config.notes.TryGetValue(instrument, out noteList)) { noteList = new List <NoteConfig>(); } var row = Instantiate(rowPrefab, rowHolder); row.Init(InstrumentHelper.GetColorForInstrument(instrument), noteList); _rowList.Add(row); SetRowForInstrument(instrument, row); } }