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.
61 lines
1.8 KiB
61 lines
1.8 KiB
3 years ago
|
using UnityEngine;
|
||
|
using System.Collections;
|
||
|
using AX.MessageSystem;
|
||
|
using AX.TrackRecord;
|
||
|
|
||
|
public class UIConsole : MonoBehaviour
|
||
|
{
|
||
|
void Start () {
|
||
|
MessageDispatcher.AddListener("OPEN", Execute, "CUBE");
|
||
|
MessageDispatcher.AddListener("CLOSE", Close, "CUBE");
|
||
|
gameObject.SetActive(false);
|
||
|
}
|
||
|
|
||
|
void Execute(IMessage message)
|
||
|
{
|
||
|
if ((string)message.Data == gameObject.name)
|
||
|
{
|
||
|
gameObject.SetActive(true);
|
||
|
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
gameObject.SetActive(false);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
void Close(IMessage message)
|
||
|
{
|
||
|
if ((string)message.Data == gameObject.name)
|
||
|
{
|
||
|
gameObject.SetActive(false);
|
||
|
if (gameObject.name == "WeatherImage")
|
||
|
{
|
||
|
if (RecordManager.Instance.IsRecording)
|
||
|
{
|
||
|
MessageDispatcher.SendMessage("RecordEditWeatherEvent");
|
||
|
}
|
||
|
if (ExamInfoHelpClass.loadSceneMode == ExamInfoHelpClass.LoadSceneMode.CreatQuestion ||
|
||
|
ExamInfoHelpClass.loadSceneMode == ExamInfoHelpClass.LoadSceneMode.EditQuestion ||
|
||
|
ExamInfoHelpClass.loadSceneMode == ExamInfoHelpClass.LoadSceneMode.CopyQuestion)
|
||
|
{
|
||
|
RecordManager.Instance.record.sceneAttribute.weatherAttri =
|
||
|
WeatherManager.Instance.WeatherAttribute;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
}
|
||
|
}
|
||
|
|
||
|
void OnDestroy()
|
||
|
{
|
||
|
MessageDispatcher.RemoveListener("OPEN", Execute, "CUBE");
|
||
|
MessageDispatcher.RemoveListener("CLOSE", Close, "CUBE");
|
||
|
}
|
||
|
//void OnDidable()
|
||
|
//{
|
||
|
// MessageDispatcher.RemoveListener("OPEN", Execute, "CUBE");
|
||
|
// MessageDispatcher.RemoveListener("CLOSE", Close, "CUBE");
|
||
|
//}
|
||
|
}
|