private static void ToggleMenuForTag(string tag) { GameObject g = GameObject.FindWithTag(tag); if(g != null) { g.GetComponent<Menu>().on = false; } }