using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class ItemMenuText : MonoBehaviour { public Text text; Image image; public void Awake() { text = transform.GetChild(1).GetComponent(); image = GetComponent(); } // Start is called before the first frame update void Start() { } // Update is called once per frame void Update() { if (image.color.a <= 0) text.gameObject.SetActive(false); else text.gameObject.SetActive(true); } }