UniVRM/Assets/UniGLTF/UniJSON/Scripts/Extensions/EnumExtensions.cs
2020-11-24 18:59:56 +09:00

16 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;
}
}
}