in my script, when I try to change the color of an item in the menu when selected (my menu works on arrows, not on the cursor, as is most often done) the color of the entire menu changes, not one item.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class MainMenuCon : MonoBehaviour
{
public GameObject[] punktsMain;
public GameObject[] punktsPlay;
public GameObject[] menus;
public Text textNow;
public int menuID = 0;
public int punktID = 0;
private int menuLenght;
public GameObject punkNow;
// Start is called before the first frame update
void Start()
{
menuLenght = punktsMain.Length;
}
// Update is called once per frame
void Update()
{
textNow.GetComponent<Text>().material.color = Color.black;
}
in textNow I have only one menu item, which changes depending on what is selected, but despite this, the color of the entire menu changes.
as you can see in the screenshot, the color of all the text turns black, but Iām trying to make it so that only the play button becomes black