当前位置:   article > 正文

unity的Ui提示框(鼠标移动,ui显示)_unity pointereventdata 鼠标位置生成ui

unity pointereventdata 鼠标位置生成ui

关键词:unity鼠标移动,ui显示

文字等提示信息

742d83d6a3b94ebab4e925604ccc2106.jpg

 

using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;
 
 
public class Test_ItemTooltip : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler, IPointerDownHandler
{
    public GameObject go;
 
    public void OnPointerDown(PointerEventData eventData)
    {
    }
    /// <summary>
    /// 进入触发显示物品信息
    /// </summary>
    /// <param name="eventData"></param>
    public void OnPointerEnter(PointerEventData eventData)
    {
        go.SetActive(true);
        go.GetComponent<RectTransform>().position = new Vector3(Input.mousePos

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/不正经/article/detail/542885
推荐阅读
相关标签
  

闽ICP备14008679号