GQ_Communicate/GQ_VR/Assets/script/UI/UISuspensionDeveloper.cs

56 lines
1.2 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.EventSystems;
[AddComponentMenu("UISuspensionDeveloper/Ðü¸¡UI")]
public class UISuspensionDeveloper : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler
{
public GameObject game;
public Text text1;
public Text text2;
public bool isexceed = false;
public void OnPointerEnter(PointerEventData eventData)
{
if (text1.preferredWidth > text1.rectTransform.rect.width ||
text1.preferredHeight > text1.rectTransform.rect.height)
{
if (isexceed)
game.transform.SetParent(PatternChoose.Inst.transform);
game.SetActive(true);
text2.gameObject.SetActive(true);
text2.text = text1.text;
}
}
public void OnPointerExit(PointerEventData eventData)
{
if (isexceed)
game.transform.SetParent(this.transform);
game.SetActive(false);
}
void Awake()
{
}
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
}