foreach (GameObject gameObj in GameObject.FindObjectsOfType<GameObject>())
{
if (gameObj.name.ToUpper() == objectsToSearch ||
gameObj.name.ToLower() == objectsToSearch)
objectsToSearch字符串可以是例如Main Camera或main camera或maIn Camera,并且无论对象组合如何匹配,我都希望它与gameObj.name匹配
例如,如果gameObj.name是Main Camera,那么如果objectToSearch是Main Camera或Main CAmera,则将其匹配为true。