using System.Collections; using System.Collections.Generic; using UnityEngine; using NaughtyAttributes; /// /// /// public static class GameObjectExtension { public static bool isTagInParent(this GameObject go, string tag) { Transform current = go.transform; while (current != null) { if (current.gameObject.CompareTag(tag)) return true; current = current.parent; } return false; } }