本文整理汇总了C++中UProperty::CopySingleValueToScriptVM方法的典型用法代码示例。如果您正苦于以下问题:C++ UProperty::CopySingleValueToScriptVM方法的具体用法?C++ UProperty::CopySingleValueToScriptVM怎么用?C++ UProperty::CopySingleValueToScriptVM使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UProperty
的用法示例。
在下文中一共展示了UProperty::CopySingleValueToScriptVM方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GenericArray_Append
void UKismetArrayLibrary::GenericArray_Append(void* TargetArray, const UArrayProperty* TargetArrayProp, void* SourceArray, const UArrayProperty* SourceArrayProperty)
{
if(TargetArray && SourceArray)
{
FScriptArrayHelper TargetArrayHelper(TargetArrayProp, TargetArray);
FScriptArrayHelper SourceArrayHelper(SourceArrayProperty, SourceArray);
if(SourceArrayHelper.Num() > 0)
{
UProperty* InnerProp = TargetArrayProp->Inner;
int32 StartIdx = TargetArrayHelper.AddValues(SourceArrayHelper.Num());
for(int32 x = 0; x < SourceArrayHelper.Num(); ++x, ++StartIdx)
{
InnerProp->CopySingleValueToScriptVM(TargetArrayHelper.GetRawPtr(StartIdx), SourceArrayHelper.GetRawPtr(x));
}
}
}
}
示例2: GenericArray_Insert
void UKismetArrayLibrary::GenericArray_Insert(void* TargetArray, const UArrayProperty* ArrayProp, const void* NewItem, int32 Index)
{
if( TargetArray )
{
FScriptArrayHelper ArrayHelper(ArrayProp, TargetArray);
UProperty* InnerProp = ArrayProp->Inner;
if (ArrayHelper.IsValidIndex(Index)
|| (Index >= 0 && Index <= ArrayHelper.Num()) )
{
ArrayHelper.InsertValues(Index, 1);
InnerProp->CopySingleValueToScriptVM(ArrayHelper.GetRawPtr(Index), NewItem);
}
else
{
FFrame::KismetExecutionMessage(*FString::Printf(TEXT("Attempted to insert an item into array %s out of bounds [%d/%d]!"), *ArrayProp->GetName(), Index, GetLastIndex(ArrayHelper)), ELogVerbosity::Warning);
}
}
}
示例3: GenericArray_Set
void UKismetArrayLibrary::GenericArray_Set(void* TargetArray, const UArrayProperty* ArrayProp, int32 Index, const void* NewItem, bool bSizeToFit)
{
if( TargetArray )
{
FScriptArrayHelper ArrayHelper(ArrayProp, TargetArray);
UProperty* InnerProp = ArrayProp->Inner;
// Expand the array, if desired
if (!ArrayHelper.IsValidIndex(Index) && bSizeToFit && (Index >= 0))
{
ArrayHelper.ExpandForIndex(Index);
}
if (ArrayHelper.IsValidIndex(Index))
{
InnerProp->CopySingleValueToScriptVM(ArrayHelper.GetRawPtr(Index), NewItem);
}
else
{
FFrame::KismetExecutionMessage(*FString::Printf(TEXT("Attempted to set an invalid index on array %s [%d/%d]!"), *ArrayProp->GetName(), Index, GetLastIndex(ArrayHelper)), ELogVerbosity::Warning);
}
}
}