using UnityEngine; using UnityEngine.EventSystems; using DG.Tweening; public class Tip : MonoBehaviour { /// /// 跟随 UI提示出现的位置 /// public Transform m_FollowObj; /// /// 偏移 /// public Vector3 m_Offset; /// /// 移动点 /// public Transform _movePos; // Update is called once per frame void Update() { if (m_FollowObj != null) { Vector3 screenPos = Camera.main.WorldToScreenPoint(m_FollowObj.position); if (screenPos.z > 0) { screenPos.z = 0; transform.position = screenPos + m_Offset; } else { transform.position = new Vector3(8888, 8888, 8888); } //if (GameManager.Instance) //{ // float distance = Vector3.Distance(m_FollowObj.transform.position, Camera.main.transform.position); // if (distance > 15 && GameManager.Instance.isShowUI)//Ui显示隐藏 // { // transform.localScale = Vector3.one * 2.1f; // } // else // { // transform.localScale = Vector3.zero; // } //} } } }