mirror of
https://github.com/ConjureETS/Unity_Utils.git
synced 2026-03-24 04:50:58 +00:00
19 lines
437 B
C#
19 lines
437 B
C#
using UnityEngine;
|
|
|
|
public static class GameObjectExtensions
|
|
{
|
|
public static int GetNumberOfComponents(this GameObject gameObject)
|
|
{
|
|
return gameObject.GetComponentsInChildren<Component>().Length - 1;
|
|
}
|
|
|
|
public static void Show(this GameObject gameObject)
|
|
{
|
|
gameObject.SetActive(true);
|
|
}
|
|
|
|
public static void Hide(this GameObject gameObject)
|
|
{
|
|
gameObject.SetActive(false);
|
|
}
|
|
} |