17 lines
479 B
C#
17 lines
479 B
C#
namespace UIExtend.Component
|
|
{
|
|
/// <summary>
|
|
/// Component 扩展方法 - SetActive
|
|
/// </summary>
|
|
public static class ComponentExtensions
|
|
{
|
|
/// <summary>
|
|
/// 显示/隐藏组件所在的GameObject
|
|
/// </summary>
|
|
public static void SetActive(this UnityEngine.Component component, bool active)
|
|
{
|
|
if (component && component.gameObject)
|
|
component.gameObject.SetActive(active);
|
|
}
|
|
}
|
|
} |