Hi Every body !
i’m creating a little game and i want to create some buttons to upgrade the player. So i create the button and the script and it work but, i just want to make a pop up with what you will upgrade ( when the mouse is over the button, a text appear and say “lvl 1 => 2 : Cooldown - 2 secs” (for exemple) but it didn’t work …
this is my scripts :
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
public class TextDisplay : MonoBehaviour {
public Text myText;
public bool displayInfo = false;
void Start(){
myText.enabled = false;
}
void Update(){
if (displayInfo == true) {
myText.enabled = true;
}
if (displayInfo == false) {
myText.enabled = false;
}
}
void OnMouseOver()
{
displayInfo = true;
}
void OnMouseExit()
{
displayInfo = false;
}
}
Thank you, that read my question !
Bye, xyHeat