using UnityEngine; using System.Collections; using UnityEngine.UI; using AX.MessageSystem; using System; using AX.TrackRecord; public class FluvioUIControl : MonoBehaviour { // Use this for initialization public Slider lifeTime; public Slider speed; public Image image; public InputField hour; public InputField minute; public InputField second; public GameObject colorPanel; private GameObject controlObject; void Start() { MessageDispatcher.AddListener("COLOR_RESET", SetColor); } void OnDestroy() { MessageDispatcher.RemoveListener("COLOR_RESET", SetColor); } private void SetColor(IMessage obj) { image.color = (Color)obj.Data; } public void ShowColorPanel() { colorPanel.SetActive(true); colorPanel.GetComponent().setRGBAValue(image.color); } public void setPanelValue(GameObject obj) { controlObject = obj; var message = controlObject.GetComponent(); lifeTime.value = message.lifeTime; speed.value = message.speed; image.color = message.color; hour.text = message.hour.ToString(); minute.text = message.minute.ToString(); second.text = message.second.ToString(); } public void submitPanelValue() { var message = controlObject.GetComponent(); message.lifeTime = lifeTime.value; message.speed = speed.value; message.color = image.color; message.hour = int.Parse(hour.text); message.minute = int.Parse(minute.text); message.second = int.Parse(second.text); message.messageValueToObj(); if (RecordManager.Instance.IsRecording) { MessageDispatcher.SendMessage("RecordEditFluvioEvent", (object)controlObject.name); } colorPanel.SetActive(false); gameObject.SetActive(false); } // Update is called once per frame void Update() { } }