using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
public class ButtonControl : IPointerEnterHandler, IPointerExitHandler
{
private GameObject childText = null; // or make public and drag
void Start(){
Text text= GetComponentInChildren<Text>();
if (text != null)
{
childText = text.gameObject;
childText.SetActive(false);
}
}
public void OnPointerEnter(EventSystems.PointerEventData eventData)
{
childText.SetActive(true);
}
public void OnPointerExit(EventSystems.PointerEventData eventData)
{
childText.SetActive(false);
}
}
im using this script so that when i highlight the button it shows some text, but i keep getting error code CS0246. It says that ‘EventSystems’ could not be found and asks if im missing an assembly reference. i have searched this up but couldnt find anything that helped. they are mostly other scripts that dont relate to my game.
i fixed it up and then i got some more errors. if fixed them and then i got this:
Assets/Shake.cs(13,48): error CS1525: Unexpected symbol `)’
i currently have this script:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;
public class Shake : MonoBehaviour {
public class ButtonControl : IPointerEnterHandler, IPointerExitHandler
{
private GameObject childText = null; // or make public and drag
void Start(){
Text text= GetComponentInChildren<"Text(3)">();
if (text != null)
{
childText = text.gameObject;
childText.SetActive(false);
}
}
public void OnPointerEnter(PointerEventData eventData)
{
childText.SetActive(true);
}
public void OnPointerExit(PointerEventData eventData)
{
childText.SetActive(false);
}
}
}
i got rid of the problem but then i got another one, and if these problems continue, i will end up with nothing. PLEASE HELP!!!
Thanks.