holopy3/Assets/UniGLTF/UniJSON/Scripts/Extensions/EnumExtensions.cs
Lena Biresch 490ef558ef CleanUp
2021-01-28 13:07:52 +01:00

15 lines
361 B
C#

using System;
namespace UniJSON
{
public static class EnumExtensions
{
public static bool HasFlag(this Enum keys, Enum flag)
{
if (keys.GetType() != flag.GetType())
throw new ArgumentException("Type Mismatch");
return (Convert.ToUInt64(keys) & Convert.ToUInt64(flag)) != 0;
}
}
}