本文整理汇总了C++中UProperty::ClearPropertyFlags方法的典型用法代码示例。如果您正苦于以下问题:C++ UProperty::ClearPropertyFlags方法的具体用法?C++ UProperty::ClearPropertyFlags怎么用?C++ UProperty::ClearPropertyFlags使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UProperty
的用法示例。
在下文中一共展示了UProperty::ClearPropertyFlags方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UpdateAgentConfig
void UNavAreaMeta_SwitchByAgent::UpdateAgentConfig()
{
Super::UpdateAgentConfig();
const UNavigationSystem* DefNavSys = (UNavigationSystem*)(UNavigationSystem::StaticClass()->GetDefaultObject());
check(DefNavSys);
const int32 MaxAllowedAgents = 16;
const int32 NumAgents = FMath::Min(DefNavSys->GetSupportedAgents().Num(), MaxAllowedAgents);
if (DefNavSys->GetSupportedAgents().Num() > MaxAllowedAgents)
{
UE_LOG(LogNavigation, Error, TEXT("Navigation system supports %d agents, but only %d can be shown in %s properties!"),
DefNavSys->GetSupportedAgents().Num(), MaxAllowedAgents, *GetClass()->GetName());
}
const FString CustomNameMeta = TEXT("DisplayName");
for (int32 i = 0; i < MaxAllowedAgents; i++)
{
const FString PropName = FString::Printf(TEXT("Agent%dArea"), i);
UProperty* Prop = FindField<UProperty>(UNavAreaMeta_SwitchByAgent::StaticClass(), *PropName);
check(Prop);
if (i < NumAgents && NumAgents > 1)
{
Prop->SetPropertyFlags(CPF_Edit);
Prop->SetMetaData(*CustomNameMeta, *FString::Printf(TEXT("Area Class for: %s"), *DefNavSys->GetSupportedAgents()[i].Name.ToString()));
}
else
{
Prop->ClearPropertyFlags(CPF_Edit);
}
}
}