本文整理汇总了C++中UPrimitiveComponent::GetComponentLevel方法的典型用法代码示例。如果您正苦于以下问题:C++ UPrimitiveComponent::GetComponentLevel方法的具体用法?C++ UPrimitiveComponent::GetComponentLevel怎么用?C++ UPrimitiveComponent::GetComponentLevel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UPrimitiveComponent
的用法示例。
在下文中一共展示了UPrimitiveComponent::GetComponentLevel方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
//.........这里部分代码省略.........
}
// Parse brush on this line.
TCHAR BrushName[NAME_SIZE];
if( FParse::Value( Str, TEXT("Name="), BrushName, NAME_SIZE ) )
{
// If an initialized brush with this name already exists in the level, rename the existing one.
// It is deemed to be initialized if it has a non-zero poly count.
// If it is uninitialized, the existing object will have been created by a forward reference in the import text,
// and it will now be redefined. This relies on the behavior that NewObject<> will return an existing pointer
// if an object with the same name and outer is passed.
UModel* ExistingBrush = FindObject<UModel>( SubobjectRoot, BrushName );
if (ExistingBrush && ExistingBrush->Polys && ExistingBrush->Polys->Element.Num() > 0)
{
ExistingBrush->Rename();
}
// Create model.
UModelFactory* ModelFactory = NewObject<UModelFactory>();
ModelFactory->FactoryCreateText( UModel::StaticClass(), SubobjectRoot, FName(BrushName, FNAME_Add, true), RF_NoFlags, NULL, TEXT("t3d"), SourceText, SourceText+FCString::Strlen(SourceText), Warn );
ImportedBrush = 1;
}
}
else if (GetBEGIN(&Str, TEXT("Foliage")))
{
UFoliageType* SourceFoliageType;
FName ComponentName;
if (SubobjectRoot &&
ParseObject<UFoliageType>(Str, TEXT("FoliageType="), SourceFoliageType, ANY_PACKAGE) &&
FParse::Value(Str, TEXT("Component="), ComponentName) )
{
UPrimitiveComponent* ActorComponent = FindObjectFast<UPrimitiveComponent>(SubobjectRoot, ComponentName);
if (ActorComponent && ActorComponent->GetComponentLevel())
{
AInstancedFoliageActor* IFA = AInstancedFoliageActor::GetInstancedFoliageActorForLevel(ActorComponent->GetComponentLevel(), true);
FFoliageMeshInfo* MeshInfo = nullptr;
UFoliageType* FoliageType = IFA->AddFoliageType(SourceFoliageType, &MeshInfo);
const TCHAR* StrPtr;
FString TextLine;
while (MeshInfo && FParse::Line(&SourceText, TextLine))
{
StrPtr = *TextLine;
if (GetEND(&StrPtr, TEXT("Foliage")))
{
break;
}
// Parse the instance properties
FFoliageInstance Instance;
FString Temp;
if (FParse::Value(StrPtr, TEXT("Location="), Temp, false))
{
GetFVECTOR(*Temp, Instance.Location);
}
if (FParse::Value(StrPtr, TEXT("Rotation="), Temp, false))
{
GetFROTATOR(*Temp, Instance.Rotation, 1);
}
if (FParse::Value(StrPtr, TEXT("PreAlignRotation="), Temp, false))
{
GetFROTATOR(*Temp, Instance.PreAlignRotation, 1);
}
if (FParse::Value(StrPtr, TEXT("DrawScale3D="), Temp, false))