Global Game Jam 2023
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

29 lines
505 B

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using NaughtyAttributes;
/// <summary>
///
/// </summary>
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;
}
}