天津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.
 
 
 
 
 
 

38 lines
956 B

using UnityEngine;
using System.Collections;
using UnityEngine.EventSystems;
using UnityEngine.UI;
public class ToolHuaGuo : MonoBehaviour,IPointerEnterHandler,IPointerExitHandler{
private GameObject TheText;
void Start ()
{
TheText = this.gameObject.transform.Find("Background").Find("Text").gameObject;
}
public void OnPointerEnter(PointerEventData eventData)
{
if (this.gameObject.name.Contains("全屏"))
{
if (this.gameObject.GetComponent<Toggle>().isOn)
{
TheText.GetComponent<Text>().text = "缩屏";
}
else
{
TheText.GetComponent<Text>().text = "全屏";
}
}
TheText.SetActive(true);
}
public void OnPointerExit(PointerEventData eventData)
{
TheText.SetActive(false);
}
public void ResetText()
{
TheText.SetActive(false);
}
}