56 lines
1.2 KiB
C#
56 lines
1.2 KiB
C#
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()
|
||
{
|
||
|
||
}
|
||
}
|