You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
59 lines
1.6 KiB
59 lines
1.6 KiB
3 years ago
|
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<Dropdown>();
|
||
|
|
||
|
WeatherConditionImage = transform.parent.parent.transform.Find("ShowWeather/WeatherImage").GetComponent<Image>();
|
||
|
}
|
||
|
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 () {
|
||
|
|
||
|
}
|
||
|
}
|