using UnityEngine; using System.Collections; using UnityEngine.UI; using AX.TrackRecord; using AX.MessageSystem; using System; public class TianQiControl : MonoBehaviour { private string WeatherText; private Dropdown WeatherPopList; private Image WeatherConditionImage; void Start () { SetAttri(); } public void SetAttri() { WeatherPopList = GetComponent(); WeatherConditionImage = transform.parent.parent.transform.Find("ShowWeather/WeatherImage").GetComponent(); } public void OnValueChanged() { if (WeatherPopList == null || WeatherConditionImage==null) { SetAttri(); } WeatherText = WeatherPopList.options[WeatherPopList.value].text; if (WeatherText == "晴") { WeatherConditionImage.sprite = Resources.Load("Weather/Qing", typeof(Sprite)) as Sprite; } if (WeatherText == "阴") { WeatherConditionImage.sprite = Resources.Load("Weather/Yin", typeof(Sprite)) as Sprite; ; } if (WeatherText == "雨") { WeatherConditionImage.sprite = Resources.Load("Weather/Yu", typeof(Sprite)) as Sprite; ; } if (WeatherText == "雪") { WeatherConditionImage.sprite = Resources.Load("Weather/Xue", typeof(Sprite)) as Sprite; ; } TOD_WeatherManager.Instance.SetWeather(WeatherText); if (RecordManager.Instance.IsRecording) { MessageDispatcher.SendMessage("RecordEditWeatherEvent"); } } void Update () { } }