天津23维预案
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.
 
 
 
 
 
 

40 lines
1.3 KiB

using UnityEngine;
using System.Collections;
using AX.MessageSystem;
using UnityEngine.UI;
public class CarAndPeopleControl : MonoBehaviour {
void Awake () {
MessageDispatcher.AddListener("CarAndPeopleColorCondition", CarAndPeopleButton);
}
void CarAndPeopleButton(IMessage message)
{
var PictureObj = transform.parent.parent.Find(gameObject.name + "Picture").gameObject;
if ((string)message.Data == this.gameObject.name)
{
MessageDispatcher.SendMessage("ResettingButton", (object)this.name);
//InstantiationTool.Instance.RSDToggle.isOn = false;
this.gameObject.transform.Find("Image").gameObject.SetActive(true);
this.gameObject.transform.Find("Text").GetComponent<Text>().color = new Color(1f, 1f, 1f, 1.000f);
PictureObj.SetActive(true);
}
else
{
PictureObj.SetActive(false);
this.gameObject.transform.Find("Image").gameObject.SetActive(false);
this.gameObject.transform.Find("Text").GetComponent<Text>().color = new Color(0.529f, 0.529f, 0.529f, 1.000f);
}
}
void Update () {
}
void OnDestroy()
{
MessageDispatcher.RemoveListener("CarAndPeopleColorCondition", CarAndPeopleButton);
}
}