unity – How can I check if TextMeshPro ui text is disabled or enabled?

Before the game start all my ui texts are disabled. They are all TextMeshPro types.

Disabled

Then when I’m running the game in one of my scripts I’m enabling only the Scene Image that also enabled his child Scene Text inside the StartTalking method :

Enabled only one

Then a text is show in the game for 10 seconds and with script the player is talking :
I’m checking if one of the texts is not empty and enabled :

using System;
using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine;
using UnityEngine.UI;
 
public class BlendShapesController : MonoBehaviour
{
    public TextMeshProUGUI() texts;
    public bool startTalking = false;
    public float talkTime;
    public float duration;
    (Range(0, 100))
    public float valueRange;
    private SkinnedMeshRenderer bodySkinnedMeshRenderer;
    private bool isTalking = true;
 
    // Start is called before the first frame update
    void Start()
    {
        bodySkinnedMeshRenderer = GetComponent<SkinnedMeshRenderer>();
    }
 
    // Update is called once per frame
    void Update()
    {
        StartTalking();
 
        if (startTalking && isTalking)
        {
            StartCoroutine(AnimateMouth());
            StartCoroutine(TalkTime());
 
            isTalking = false;
        }
 
        if (startTalking == false && isTalking == false)
        {
            isTalking = true;
        }
    }
 
    //Lerp between startValue and endValue over 'duration' seconds
    private IEnumerator LerpShape(float startValue, float endValue, float duration)
    {
        float elapsed = 0;
        while (elapsed < duration)
        {
            elapsed += Time.deltaTime;
            float value = Mathf.Lerp(startValue, endValue, elapsed / duration);
            bodySkinnedMeshRenderer.SetBlendShapeWeight(0, value);
            yield return null;
        }
    }
 
    //animate open and closed, then repeat
    public IEnumerator AnimateMouth()
    {
        while (startTalking == true)
        {
            yield return StartCoroutine(LerpShape(0, valueRange, duration));
            yield return StartCoroutine(LerpShape(valueRange, 0, duration));
        }
    }
 
    public IEnumerator TalkTime()
    {
        yield return new WaitForSeconds(talkTime);
 
        startTalking = false;
    }
 
    public void StartTalking()
    {
        for (int i = 0; i < texts.Length; i++)
        {
            if (texts(i).text != "" && texts(i).enabled == true)
            {
                startTalking = true;
            }
        }
    }
}

Then after 10 seconds I’m disabling the Scene Image and the Scene Text is also get disabled :

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Cinemachine;
using UnityEngine.UI;
using UnityEngine.SceneManagement;
using SpeedTutorMainMenuSystem;
using System.IO;
 
public class PlayingInGameScenesController : MonoBehaviour
{
    public CinemachineFreeLook() freeLookCams;
    public CinemachineVirtualCamera() virtualCams;
    public LockController lockController;
    public GameObject player;
    public GameObject uiSceneText;
    public float transitionSpeed = 5f;
    public float thresHold = 0.1f;
    public bool talkingProcess = true;
    public SaveLoad saveLoad;
    public bool newGameHasLoaded = false;
 
    private bool newGame = true;
    private bool loaded = false;
 
    private void Start()
    {
     
    }
    public void PlayingSceneInGame()
    {
        PlayingSceneStatesControls(true);
        StartCoroutine(ScenePlayingTime());
    }
 
    private void Update()
    {
        if (SceneManager.GetActiveScene().name != "Main Menu" && newGame == true && MenuController.LoadSceneForSavedGame == false)
        {
            PlayingSceneInGame();
            newGame = false;
        }
 
        if (SceneManager.GetActiveScene().name != "Main Menu" && MenuController.LoadSceneForSavedGame == true && loaded == false)
        {
            newGameHasLoaded = true;
            loaded = true;
        }
    }
 
    private void LateUpdate()
    {
       
    }
 
    private void PlayingSceneStatesControls(bool LockState)
    {
        lockController.LockControl(LockState);
 
        if (LockState == true)
        {
            uiSceneText.SetActive(true);
        }
        else
        {
            talkingProcess = false;
            uiSceneText.SetActive(false);
        }
    }
 
    IEnumerator ScenePlayingTime()
    {
        yield return new WaitForSeconds(10);
 
        PlayingSceneStatesControls(false);
 
        freeLookCams(0).enabled = false;
        freeLookCams(1).enabled = true;
 
        var brain = Camera.main.GetComponent<CinemachineBrain>().m_DefaultBlend.m_Time;
 
        StartCoroutine(saveLoad.SaveWithTime());
    }
}

This line disable it back after 10 seconds :

uiSceneText.SetActive(false);

So now both the Image and the Text are disabled like before running the game.
But for some reason in the first script it keep getting inside in the StartTalking method and set the flag to true :

public void StartTalking()
    {
        for (int i = 0; i < texts.Length; i++)
        {
            if (texts(i).text != "" && texts(i).enabled == true)
            {
                startTalking = true;
            }
        }
    }

All the texts now are disabled one of them is not empty but they are all disabled and still it’s getting inside and set the startTalking flag to true.

texts are TextMeshProUGUI types so I wonder why it’s setting the flag to true if they are disabled ?
Because in the second script I disabled back the Image of the scene it’s also disabling the child text but still it’s getting inside and setting the flag to true.