18 lines
497 B
C#
18 lines
497 B
C#
using UnityEngine;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
|
|
public static class Helper
|
|
{
|
|
public static GameObject[] GetTaggedChildren(GameObject parent, string tag) {
|
|
List<GameObject> childrenWithTag = new List<GameObject>();
|
|
foreach (Transform child in parent.transform)
|
|
{
|
|
if (child.CompareTag(tag))
|
|
{
|
|
childrenWithTag.Add(child.gameObject);
|
|
}
|
|
}
|
|
return childrenWithTag.ToArray();
|
|
}
|
|
}
|