46 lines
1.2 KiB
C#
46 lines
1.2 KiB
C#
using TMPro;
|
|
using UnityEngine;
|
|
using XED.HierarchyTree;
|
|
|
|
namespace XED.UI
|
|
{
|
|
public class PopupScrollViewMenu : MonoBehaviour
|
|
{
|
|
private HierarchyScrollRect scrollRect;
|
|
private Canvas canvas;
|
|
// Start is called before the first frame update
|
|
void Awake()
|
|
{
|
|
canvas = GetComponentInParent<Canvas>();
|
|
scrollRect = GetComponentInParent<HierarchyScrollRect>();
|
|
scrollRect.menuPopup = gameObject;
|
|
gameObject.SetActive(false);
|
|
}
|
|
private void OnEnable()
|
|
{
|
|
RectTransformUtility.ScreenPointToLocalPointInRectangle(
|
|
canvas.transform as RectTransform,
|
|
Input.mousePosition,
|
|
canvas.worldCamera,
|
|
out Vector2 pos
|
|
);
|
|
transform.position = canvas.transform.TransformPoint(pos);
|
|
}
|
|
private void OnDisable()
|
|
{
|
|
|
|
}
|
|
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
|
void Start()
|
|
{
|
|
|
|
}
|
|
|
|
// Update is called once per frame
|
|
void Update()
|
|
{
|
|
|
|
}
|
|
}
|
|
}
|