|
|
@ -0,0 +1,29 @@ |
|
|
|
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; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |