// Use this for initialization //PRE: Assign panel to the panel variable in inspector void Start() { if (true) //need to check for file path validity { InputData = XmlIO.Load(xmlPath, typeof(SunlightWidgetData)) as SunlightWidgetData; } // Debug.Log("input loaded: " + InputData); //this section initializes the UI with the inputData loaded from the xml populateCityDropDown(InputData.ListOfCity, cityDropdown, cityButPrefab); populateTimeLabels(InputData); currentCityOnDisplay.text = InputData.CurrentCity.CityName; //set up reference to hourSlider hourSlider = transform.FindChild("mainPanel").FindChild("Slider") as RectTransform; dayLightSaving = false; }
// Use this for initialization //PRE: Assign panel to the panel variable in inspector void Start() { if(true){//need to check for file path validity InputData = XmlIO.Load(xmlPath, typeof(SunlightWidgetData)) as SunlightWidgetData; } // Debug.Log("input loaded: " + InputData); //this section initializes the UI with the inputData loaded from the xml populateCityDropDown(InputData.ListOfCity, cityDropdown,cityButPrefab); populateTimeLabels(InputData); currentCityOnDisplay.text = InputData.CurrentCity.CityName; //set up reference to hourSlider hourSlider = transform.FindChild("mainPanel").FindChild("Slider") as RectTransform; dayLightSaving = false; }
void populateTimeLabels(SunlightWidgetData database) { dateLabelText.text = database.Date.ToString(); monthLabelText.text = database.Month.ToString(); yearLabelText.text = database.Year.ToString(); }