This repository has been archived on 2025-06-25. You can view files and clone it, but cannot push or open issues or pull requests.
Net.Like.Xue.Tokyo/Assets/BITKit/Core/Extensions/Object.cs

24 lines
479 B
C#

using System;
namespace BITKit
{
public static partial class Extensions
{
public static T IsNull<T>(this T t, Action action)
{
if (t is null)
{
action.Invoke();
}
return t;
}
public static T IsNotNull<T>(this T t, Action<T> action)
{
if (t is not null)
{
action.Invoke(t);
}
return t;
}
}
}