I have the following simple validation to check if an UI pane is present in the scene:
public static bool IsMenuDialogActive()
{
return GameObject.FindGameObjectsWithTag("MenuDialog").Length > 0;
}
And i have two UI GameObjects that call that method, 'A' and 'B', and B is a child of A. 'A' is an object that can have one or more 'MenuDialog' child objects active at a time.
----------
If I call IsMenuDialogActive() from within 'A' it returns true if any of these child objects is active. But if call it from within 'B' it returns zero objects. I suspect that FindGameObjectsWithTag only searches for tagged objects within the hierarchy of the object that calls it. But this is not clear from the documentation for FindGameObjectsWithTag. Is this a correct assumption?
↧