46 lines
1.0 KiB
C#
46 lines
1.0 KiB
C#
using UnityEngine.UI;
|
|
using TMPro;
|
|
using UnityEngine;
|
|
|
|
public class ItemTips : BasePanel
|
|
{
|
|
public void Init(string Item)
|
|
{
|
|
GetControl<TextMeshProUGUI>("ItemText").text = Item;
|
|
GetControl<Image>("Bg").rectTransform.sizeDelta = new Vector2(120, 36);
|
|
|
|
//Vector2 worldPosition = GetControl<Image>("Bg").rectTransform.position;
|
|
//Vector2 localPosition = GetControl<Image>("Bg").rectTransform.InverseTransformPoint(worldPosition);
|
|
//GetControl<Image>("Bg").rectTransform.localPosition = localPosition;
|
|
HideMe();
|
|
}
|
|
void Start()
|
|
{
|
|
|
|
}
|
|
void Update()
|
|
{
|
|
transform.position = Input.mousePosition + new Vector3(10, 10, 0);
|
|
}
|
|
public override void ShowMe()
|
|
{
|
|
|
|
}
|
|
|
|
public override void HideMe()
|
|
{
|
|
|
|
}
|
|
|
|
//protected override void OnClick(string btnName)
|
|
//{
|
|
|
|
// switch (btnName)
|
|
// {
|
|
// case "":
|
|
// break;
|
|
// default:
|
|
// break;
|
|
// }
|
|
//}
|
|
} |