public void populateSiteSelectorList() { for (int i = 0; i < sitesInCounty.Count; i++) { // add the county header GameObject newCountyHeader = Instantiate(countyListItemPref, siteListContent); localization lcl = newCountyHeader.GetComponentInChildren <localization>(); lcl.termEnglish = countiesEn[i]; lcl.termChinese = countiesTwn[i]; if (userSettings.language == languages.eng) { newCountyHeader.GetComponentInChildren <Text>().text = lcl.termEnglish; } else { newCountyHeader.GetComponentInChildren <Text>().text = lcl.termChinese; } for (int j = 0; j < sitesInCounty[i].Length; j++) { // add UI buttons for each site GameObject newSiteSelector = Instantiate(siteListItemPref, siteListContent); selectSite slctSite = newSiteSelector.GetComponentInChildren <selectSite>(); slctSite.siteIndex = sitesInCounty[i][j]; slctSite.GetComponent <Toggle>().group = siteListContent.GetComponent <ToggleGroup>(); localization local = newSiteSelector.GetComponentInChildren <localization>(); local.termEnglish = data.EnglishNames[sitesInCounty[i][j]]; local.termChinese = data.ChineseNames[sitesInCounty[i][j]]; if (userSettings.language == languages.eng) { newSiteSelector.GetComponentInChildren <Text>().text = local.termEnglish; } else { newSiteSelector.GetComponentInChildren <Text>().text = local.termChinese; } } } }
void Start() { data = GetComponent <dataLoader>(); clock.OnBar += everyBar; //clock.OnBeat += everyBeat; //clock.OnPulse += everyPulse; numScales = Scale.GetNames(typeof(Scale)).Length; styles = transform.Find("Styles").GetComponents <Style>(); // add UI buttons for each style for (int i = 0; i < styles.Length; i++) { GameObject newStyleSelector = Instantiate(styleSelectorPref, stylesListGO.transform); selectStyle slctStyle = newStyleSelector.GetComponentInChildren <selectStyle>(); slctStyle.styleIndex = i; slctStyle.GetComponent <Toggle>().group = stylesListGO.GetComponent <ToggleGroup>(); localization local = newStyleSelector.GetComponentInChildren <localization>(); if (local == null) { Debug.Break(); } local.termEnglish = styles[i].StyleNameEng; local.termChinese = styles[i].StyleNameChTw; if (userSettings.language == languages.eng) { newStyleSelector.GetComponentInChildren <Text>().text = local.termEnglish; } else { newStyleSelector.GetComponentInChildren <Text>().text = local.termChinese; } } // set the first style as default switchStyle(1); }
public IShellContext Capture() => new DesktopShellContext(localization, Window ?? throw new InvalidOperationException("Not called from UI thread."));