public static T[] FindGameObjectsWithTag <T>(Generics.Tag tag) where T : Component { GameObject[] array = GameObject.FindGameObjectsWithTag(tag.ToString()); T[] array2 = new T[array.Length]; int num = 0; GameObject[] array3 = array; foreach (GameObject gameObject in array3) { array2[num] = gameObject.GetComponent <T>(); num++; } return(array2); }
public static GameObject[] FindGameObjectsWithTag(Generics.Tag tag) { return(GameObject.FindGameObjectsWithTag(tag.ToString())); }
public static T FindObjectWithTag <T>(Generics.Tag tag) where T : Component { return(GameObject.FindGameObjectWithTag(tag.ToString()).SafeGetComponent <T>()); }