UniVRM/Scripts/Extensions/EnumExtensions.cs
ousttrue df5f795843 Squashed 'UniJSON/' content from commit 8e22468
git-subtree-dir: UniJSON
git-subtree-split: 8e224689031f2a5e6ea30872e60fe808ddfdc31d
2018-12-28 20:36:46 +09:00

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