public void InitToggles() { for (int i = 0; i < LineContainer.transform.childCount; i++) { var child = LineContainer.transform.GetChild(i); MeasureCreatorTowerLine line = child.GetComponent <MeasureCreatorTowerLine>(); var tower = TowerSoundSources[i]; line.SetToggles(tower.MeasurePlayTimes); } }
public void UpdateTowerSoundSources() { for (int i = 0; i < LineContainer.transform.childCount; i++) { var child = LineContainer.transform.GetChild(i); MeasureCreatorTowerLine line = child.GetComponent <MeasureCreatorTowerLine>(); var tower = TowerSoundSources[i]; tower.MeasurePlayTimes = line.GetMeasuresArray(); } }
// Use this for initialization void Start() { foreach (var tower in TowerSoundSources) { var newLine = Instantiate(LinePrefab); newLine.transform.SetParent(LineContainer.transform); MeasureCreatorTowerLine towerLine = newLine.GetComponent <MeasureCreatorTowerLine>(); towerLine.SetTowerSoundSource(tower); } InitToggles(); UpdateBeatKeeper(); }