I’m trying to implement different languages.
i have a canvas showing numerous buttons, almost 100 buttons. most of which are turned off, until another buttons turns them on.
each button has 2x textmesh pro objects. 1 English, 1 French.
in my options i want to click on my french button and it turns off all English text and turns on all French text. All English text is tagged “English” and the French is tagged as “French”
Using a script i can hide some of the English tagged objects, but only for game objects that are active. its does not hide text that is a child of a button that is currently hidden. So when i turn a new button on, the English text is visible but cant unhide (Set active True) the french tagged objects. so i just have buttons with no text.
Any ideas on how i can achieve this would be grateful. i would like to use tags as there is just so much text objects.
So its almost working, i just need to be able to hide / Setactive false objects that are child of game objects that are turned off.
below is the code i’m using
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class ShowFrench : MonoBehaviour
{
public GameObject[] english;
public GameObject[] french;
void Start()
{
english = GameObject.FindGameObjectsWithTag("English");
english = GameObject.FindGameObjectsWithTag("French");
}
public void Disable()
{
foreach (GameObject e in english)
{
e.SetActive(false);
}
}
public void Enable()
{
foreach (GameObject f in french)
{
f.SetActive(true);
}
}