Check out example codes for "unity find object of type inactive". It will help you in understanding the concepts better.

Code Example 1

/// Use this method to get all loaded objects of some type, including inactive objects.
/// This is an alternative to Resources.FindObjectsOfTypeAll (returns project assets, including prefabs), and GameObject.FindObjectsOfTypeAll (deprecated).
public static List<T> FindObjectsOfTypeAll<T>() {
	List<T> results = new List<T>();
    for(int i = 0; i< SceneManager.sceneCount; i++) {
		var s = SceneManager.GetSceneAt(i);
    	if (s.isLoaded) {
      		var allGameObjects = s.GetRootGameObjects();
          	for (int j = 0; j < allGameObjects.Length; j++) {
            	var go = allGameObjects[j];
  	return results; 

Learn ReactJs, React Native from