17 lines
335 B
C#
17 lines
335 B
C#
using UnityEngine;
|
|
|
|
namespace KitsuneCafe.Extension
|
|
{
|
|
public static class GameObjectExtensions
|
|
{
|
|
public static bool TryGetComponentIfNull<T>(this Component gameObject, ref T component)
|
|
{
|
|
if (component == null)
|
|
{
|
|
return gameObject.TryGetComponent(out component);
|
|
}
|
|
|
|
return false;
|
|
}
|
|
}
|
|
}
|