Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ namespace UnLua
TypeInterface = GetBoolProperty();
break;
case LUA_TNUMBER:
TypeInterface = lua_isinteger(L, Index) > 0 ? GetIntProperty() : GetFloatProperty();
TypeInterface = lua_isinteger(L, Index) > 0 ? GetInt64Property() : GetFloatProperty();
break;
case LUA_TSTRING:
TypeInterface = GetStringProperty();
Expand Down Expand Up @@ -144,6 +144,33 @@ namespace UnLua
}
return IntProperty;
}

TSharedPtr<ITypeInterface> FPropertyRegistry::GetInt64Property()
{
if (!Int64Property)
{
#if UE_VERSION_OLDER_THAN(5, 1, 0)
const auto Property = new FInt64Property(PropertyCollector, NAME_None, RF_Transient, 0, CPF_HasGetValueTypeHash);
#else
constexpr auto Params = UECodeGen_Private::FInt64PropertyParams
{
nullptr,
nullptr,
CPF_HasGetValueTypeHash,
UECodeGen_Private::EPropertyGenFlags::Int64,
RF_Transient,
1,
nullptr,
nullptr,
0,
METADATA_PARAMS(nullptr, 0)
};
const auto Property = new FInt64Property(PropertyCollector, Params);
#endif
Int64Property = TSharedPtr<ITypeInterface>(FPropertyDesc::Create(Property));
}
return Int64Property;
}

TSharedPtr<ITypeInterface> FPropertyRegistry::GetFloatProperty()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ namespace UnLua
private:
TSharedPtr<ITypeInterface> GetBoolProperty();
TSharedPtr<ITypeInterface> GetIntProperty();
TSharedPtr<ITypeInterface> GetInt64Property();
TSharedPtr<ITypeInterface> GetFloatProperty();
TSharedPtr<ITypeInterface> GetStringProperty();
TSharedPtr<ITypeInterface> GetNameProperty();
Expand All @@ -53,6 +54,7 @@ namespace UnLua
TMap<UField*, TSharedPtr<ITypeInterface>> FieldProperties;
TSharedPtr<ITypeInterface> BoolProperty;
TSharedPtr<ITypeInterface> IntProperty;
TSharedPtr<ITypeInterface> Int64Property;
TSharedPtr<ITypeInterface> FloatProperty;
TSharedPtr<ITypeInterface> StringProperty;
TSharedPtr<ITypeInterface> NameProperty;
Expand Down