Add simpler Variant::Enum that auto-setups variant type from enum scripting info
This commit is contained in:
@@ -421,6 +421,15 @@ public:
|
||||
return MoveTemp(v);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
static typename TEnableIf<TIsEnum<T>::Value, Variant>::Type Enum(const T value)
|
||||
{
|
||||
Variant v;
|
||||
v.SetType(VariantType(VariantType::Enum, StaticType<T>().GetType()));
|
||||
v.AsUint64 = (uint64)value;
|
||||
return MoveTemp(v);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
static typename TEnableIf<!TIsEnum<T>::Value && !TIsPointer<T>::Value, Variant>::Type Structure(VariantType&& type, const T& value)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user