I did a search for an element of the required data type in the GameObject[] array, but I would like to do it via LINQ, how do I do it?
I did it through the foreach loop, but I need to through LINQ
private void OnSceneLoaded(Scene scene, LoadSceneMode loadSceneMode)
{
if (scene.buildIndex == 2)
{
var sceneObjects = scene.GetRootGameObjects();
foreach (var obj in sceneObjects)
{
if(obj.GetComponent<SumoUIManager>())
sumoUIManager = obj.GetComponent<SumoUIManager>();
}
}
}