UdonToolkit
UdonToolkit copied to clipboard
Popup attribute does not work for int-like variables, such as bytes
that is all
I need to look up a way to determine if the variable is int-like i guess
So apparently this is the correct way of doing it
private static HashSet<Type> NumericTypes = new HashSet<Type>
{
typeof(int),
typeof(uint),
typeof(double),
typeof(decimal),
...
};
internal static bool IsNumericType(Type type)
{
return NumericTypes.Contains(type) ||
NumericTypes.Contains(Nullable.GetUnderlyingType(type));
}
sigh
Just literally have a hash set of compatible types :/