31 lines
600 B
C#
31 lines
600 B
C#
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<Text>();
|
|
image = GetComponent<Image>();
|
|
}
|
|
// 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);
|
|
}
|
|
}
|