Пример #1
0
    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);
    }
Пример #2
0
 public static GameObject[] FindGameObjectsWithTag(Generics.Tag tag)
 {
     return(GameObject.FindGameObjectsWithTag(tag.ToString()));
 }
Пример #3
0
 public static T FindObjectWithTag <T>(Generics.Tag tag) where T : Component
 {
     return(GameObject.FindGameObjectWithTag(tag.ToString()).SafeGetComponent <T>());
 }