TapLogin-Unity/Standalone/Runtime/Internal/UI.cs

23 lines
457 B
C#
Raw Normal View History

2023-06-30 22:56:25 +08:00
using UnityEngine;
namespace TapTap.Login.Internal
{
internal static class UIOperation
{
// ReSharper disable Unity.PerformanceAnalysis
public static T GetComponent<T>(GameObject obj) where T : Component
{
T component = obj.GetComponent<T>();
if (component == null)
{
component = obj.AddComponent<T>();
}
return component;
}
}
}