2023-12-13 12:49:38 +01:00

41 lines
1.0 KiB
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.EventSystems;
using Assets.Scripts.Player;
namespace Assets.Scripts
{
public class TooltipHandler : MonoBehaviour
{
public GameObject tooltip;
PlayerGameObject player;
UIHandler uihandler;
// Start is called before the first frame update
void Start()
{
player = GameObject.Find("Player").GetComponent<PlayerGameObject>();
uihandler = GameObject.Find("UIHandler").GetComponent<UIHandler>();
}
// Update is called once per frame
void Update()
{
}
public void showTooltip(string text)
{
tooltip.transform.Find("txtTooltip").GetComponent<Text>().text = text;
tooltip.transform.localScale = new Vector3(1,1,1);
}
public void hideToolTip()
{
tooltip.transform.localScale = new Vector3(0,0,0);
}
}
}