当前位置: 首页>>代码示例>>C++>>正文


C++ UObject::GetName方法代码示例

本文整理汇总了C++中UObject::GetName方法的典型用法代码示例。如果您正苦于以下问题:C++ UObject::GetName方法的具体用法?C++ UObject::GetName怎么用?C++ UObject::GetName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UObject的用法示例。


在下文中一共展示了UObject::GetName方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ExportTextItem

void UObjectPropertyBase::ExportTextItem( FString& ValueStr, const void* PropertyValue, const void* DefaultValue, UObject* Parent, int32 PortFlags, UObject* ExportRootScope ) const
{
	UObject* Temp = GetObjectPropertyValue(PropertyValue);
	if( Temp != NULL )
	{
		if (PortFlags & PPF_DebugDump)
		{
			ValueStr += Temp->GetFullName();
		}
		else if (Parent && !Parent->HasAnyFlags(RF_ClassDefaultObject) && Temp->IsDefaultSubobject())
		{
			if ((PortFlags & PPF_Delimited) && (!Temp->GetFName().IsValidXName(INVALID_OBJECTNAME_CHARACTERS)))
			{
				ValueStr += FString::Printf(TEXT("\"%s\""), *Temp->GetName().ReplaceQuotesWithEscapedQuotes());
			}
			else
			{
				ValueStr += Temp->GetName();
			}
		}
		else
		{
			ValueStr += GetExportPath(Temp, Parent, ExportRootScope, PortFlags);
		}
	}
	else
	{
		ValueStr += TEXT("None");
	}
}
开发者ID:amyvmiwei,项目名称:UnrealEngine4,代码行数:30,代码来源:PropertyBaseObject.cpp

示例2: GetObjectName

FText SGraphPinObject::GetObjectName() const
{
	FText Value = FText::GetEmpty();
	
	if (GraphPinObj != NULL)
	{
		UObject* DefaultObject = GraphPinObj->DefaultObject;
		if (DefaultObject != NULL)
		{
			Value = FText::FromString(DefaultObject->GetName());
			int32 StringLen = Value.ToString().Len();

			//If string is too long, then truncate (eg. "abcdefgijklmnopq" is converted as "abcd...nopq")
			const int32 MaxAllowedLength = 16;
			if (StringLen > MaxAllowedLength)
			{
				//Take first 4 characters
				FString TruncatedStr(Value.ToString().Left(4));
				TruncatedStr += FString( TEXT("..."));
				
				//Take last 4 characters
				TruncatedStr += Value.ToString().Right(4);
				Value = FText::FromString(TruncatedStr);
			}
		}
	}
	return Value;
}
开发者ID:Codermay,项目名称:Unreal4,代码行数:28,代码来源:SGraphPinObject.cpp

示例3: FindObject

UObject* UObject::FindObject ( wchar_t* ObjectName )
{
	for ( int i = 0; i < UObject::GObjObjects()->Count; ++i )
	{
		UObject *pObject = GObjObjects()->Data[ i ];

		if ( pObject == NULL )
			continue;

		if( pObject->GetName().compare( ObjectName ) == 0 )
			return pObject;

		wstring FullName = pObject->GetFullName();

		if( FullName.length() )
		{
			if ( FullName.compare( ObjectName ) == 0 )
			{
				return pObject;
			}
		}
	}

	return NULL;
}
开发者ID:thisgamesux,项目名称:ue3gen,代码行数:25,代码来源:SDK_Main.cpp

示例4: ExportTextItem

void UObjectPropertyBase::ExportTextItem( FString& ValueStr, const void* PropertyValue, const void* DefaultValue, UObject* Parent, int32 PortFlags, UObject* ExportRootScope ) const
{
	UObject* Temp = GetObjectPropertyValue(PropertyValue);

	if (0 != (PortFlags & PPF_ExportCpp))
	{
		FString::Printf(TEXT("%s%s*"), PropertyClass->GetPrefixCPP(), *PropertyClass->GetName());

		ValueStr += Temp
			? FString::Printf(TEXT("LoadObject<%s%s>(nullptr, TEXT(\"%s\"))")
				, PropertyClass->GetPrefixCPP()
				, *PropertyClass->GetName()
				, *(Temp->GetPathName().ReplaceCharWithEscapedChar()))
			: TEXT("nullptr");
		return;
	}

	if( Temp != NULL )
	{
		if (PortFlags & PPF_DebugDump)
		{
			ValueStr += Temp->GetFullName();
		}
		else if (Parent && !Parent->HasAnyFlags(RF_ClassDefaultObject) && Temp->IsDefaultSubobject())
		{
			if ((PortFlags & PPF_Delimited) && (!Temp->GetFName().IsValidXName(INVALID_OBJECTNAME_CHARACTERS)))
			{
				ValueStr += FString::Printf(TEXT("\"%s\""), *Temp->GetName().ReplaceQuotesWithEscapedQuotes());
			}
			else
			{
				ValueStr += Temp->GetName();
			}
		}
		else
		{
			ValueStr += GetExportPath(Temp, Parent, ExportRootScope, PortFlags);
		}
	}
	else
	{
		ValueStr += TEXT("None");
	}
}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:44,代码来源:PropertyBaseObject.cpp

示例5: OnGetComboTextValue

FText SGraphPinObject::OnGetComboTextValue() const
{
	FText Value = GetDefaultComboText();
	
	if (GraphPinObj != NULL)
	{
		UObject* DefaultObject = GraphPinObj->DefaultObject;
		if (DefaultObject != NULL)
		{
			Value = FText::FromString(DefaultObject->GetName());
		}
	}
	return Value;
}
开发者ID:Tigrouzen,项目名称:UnrealEngine-4,代码行数:14,代码来源:SGraphPinObject.cpp

示例6: SaveDuplicatedAsset

		/**
		* Saves the duplicated asset
		*/
		void SaveDuplicatedAsset()
		{
			if (DuplicatedPackage && DuplicatedAsset)
			{
				DuplicatedPackage->SetDirtyFlag(true);
				const FString PackagePath = FString::Printf(TEXT("%s/%s_Copy"), *GetGamePath(), *AssetName);
				if (UPackage::SavePackage(DuplicatedPackage, NULL, RF_Standalone, *FPackageName::LongPackageNameToFilename(PackagePath, FPackageName::GetAssetPackageExtension()), GError, nullptr, false, true, SAVE_NoError))
				{
					TestStats->NumDuplicatesSaved++;
					UE_LOG(LogEditorAssetAutomationTests, Display, TEXT("Saved asset %s (%s)"), *DuplicatedAsset->GetName(), *Class->GetName());
				}
				else
				{
					UE_LOG(LogEditorAssetAutomationTests, Display, TEXT("Unable to save asset %s (%s)"), *DuplicatedAsset->GetName(), *Class->GetName());
				}
			}
		}
开发者ID:kidaa,项目名称:UnrealEngineVR,代码行数:20,代码来源:EditorAssetAutomationTests.cpp

示例7: GetObjectDisplayName

FString SObjectNameEditableTextBox::GetObjectDisplayName(TWeakObjectPtr<UObject> Object)
{
	FString Result;
	if(Object.IsValid())
	{
		UObject* ObjectPtr = Object.Get();
		if (ObjectPtr->IsA(AActor::StaticClass()))
		{
			Result =  ((AActor*)ObjectPtr)->GetActorLabel();
		}
		else
		{
			Result = ObjectPtr->GetName();
		}
	}
	return Result;
}
开发者ID:Tigrouzen,项目名称:UnrealEngine-4,代码行数:17,代码来源:SObjectNameEditableTextBox.cpp

示例8: CreateComponentFromTemplate

UActorComponent* AActor::CreateComponentFromTemplate(UActorComponent* Template, const FString& InName)
{
	UActorComponent* NewActorComp = NULL;
	if(Template != NULL)
	{
		// If there is a Component with this name already (almost certainly because it is an Instance component), we need to rename it out of the way
		if (!InName.IsEmpty())
		{
			UObject* ConflictingObject = FindObjectFast<UObject>(this, *InName);
			if (ConflictingObject && ConflictingObject->IsA<UActorComponent>() && CastChecked<UActorComponent>(ConflictingObject)->CreationMethod == EComponentCreationMethod::Instance)
			{		
				// Try and pick a good name
				FString ConflictingObjectName = ConflictingObject->GetName();
				int32 CharIndex = ConflictingObjectName.Len()-1;
				while (FChar::IsDigit(ConflictingObjectName[CharIndex]))
				{
					--CharIndex;
				}
				int32 Counter = 0;
				if (CharIndex < ConflictingObjectName.Len()-1)
				{
					Counter = FCString::Atoi(*ConflictingObjectName.RightChop(CharIndex+1));
					ConflictingObjectName = ConflictingObjectName.Left(CharIndex+1);
				}
				FString NewObjectName;
				do
				{
					NewObjectName = ConflictingObjectName + FString::FromInt(++Counter);
					
				} while (FindObjectFast<UObject>(this, *NewObjectName) != nullptr);

				ConflictingObject->Rename(*NewObjectName, this);
			}
		}

		// Note we aren't copying the the RF_ArchetypeObject flag. Also note the result is non-transactional by default.
		NewActorComp = (UActorComponent*)StaticDuplicateObject(Template, this, *InName, RF_AllFlags & ~(RF_ArchetypeObject|RF_Transactional|RF_WasLoaded|RF_Public|RF_InheritableComponentTemplate) );

		NewActorComp->CreationMethod = EComponentCreationMethod::UserConstructionScript;

		// Need to do this so component gets saved - Components array is not serialized
		BlueprintCreatedComponents.Add(NewActorComp);
	}
	return NewActorComp;
}
开发者ID:johndpope,项目名称:UE4,代码行数:45,代码来源:ActorConstruction.cpp

示例9: OnGetComboTextValue

FText SGraphPinObject::OnGetComboTextValue() const
{
	FText Value = GetDefaultComboText();
	
	if (GraphPinObj != NULL)
	{
		UObject* DefaultObject = GraphPinObj->DefaultObject;
		if (UField* Field = Cast<UField>(DefaultObject))
		{
			Value = Field->GetDisplayNameText();
		}
		else if (DefaultObject != NULL)
		{
			Value = FText::FromString(DefaultObject->GetName());
		}
	}
	return Value;
}
开发者ID:Codermay,项目名称:Unreal4,代码行数:18,代码来源:SGraphPinObject.cpp

示例10: GetInterpPropertyNames

	void GetInterpPropertyNames(UObject* InObject, const FString& Prefix)
	{
		UClass* ObjectClass = InObject->GetClass();

		// First search for any properties in this object
		for (TFieldIterator<UProperty> ClassFieldIt(ObjectClass); ClassFieldIt; ++ClassFieldIt)
		{
			UProperty* ClassMemberProperty = *ClassFieldIt;
			if (ClassMemberProperty->HasAnyPropertyFlags(CPF_Interp))
			{
				// Is this property the desired type?
				if (IsDesiredProperty(ClassMemberProperty))
				{
					const FString QualifiedFullPath = FString::Printf(TEXT("%s%s"), *Prefix, *ClassMemberProperty->GetName());
					GatheredPropertyPaths.Add(*QualifiedFullPath);
				}

				// If this is a struct, look for any desired properties inside of it
				if (UStructProperty* OuterStructProperty = Cast<UStructProperty>(ClassMemberProperty))
				{
					for (TFieldIterator<UProperty> StructFieldIt(OuterStructProperty->Struct); StructFieldIt; ++StructFieldIt)
					{
						UProperty* StructMemberProperty = *StructFieldIt;
						if (StructMemberProperty->HasAnyPropertyFlags(CPF_Interp) && IsDesiredProperty(StructMemberProperty))
						{
							const FString QualifiedFullPath = FString::Printf(TEXT("%s%s.%s"), *Prefix, *OuterStructProperty->GetName(), *StructMemberProperty->GetName());
							GatheredPropertyPaths.Add(*QualifiedFullPath);
						}
					}
				}
			}
		}

		// Then iterate over each subobject of this object looking for interp properties.
		TArray<UObject*> DefaultSubObjects;
		ObjectClass->GetDefaultObjectSubobjects(DefaultSubObjects);
		for (int32 SubObjectIndex = 0; SubObjectIndex < DefaultSubObjects.Num(); ++SubObjectIndex)
		{
			UObject* Component = DefaultSubObjects[SubObjectIndex];
			const FString ComponentPrefix = Component->GetName() + TEXT(".");

			GetInterpPropertyNames(Component, ComponentPrefix); 
		}
	}
开发者ID:1vanK,项目名称:AHRUnrealEngine,代码行数:44,代码来源:MatineeUtils.cpp

示例11: DescribeSelfToVisLog

void UCrowdFollowingComponent::DescribeSelfToVisLog(FVisualLogEntry* Snapshot) const
{
	if (!bEnableCrowdSimulation)
	{
		Super::DescribeSelfToVisLog(Snapshot);
		return;
	}

	FVisualLogStatusCategory Category;
	Category.Category = TEXT("Path following");

	if (DestinationActor.IsValid())
	{
		Category.Add(TEXT("Goal"), GetNameSafe(DestinationActor.Get()));
	}

	FString StatusDesc = GetStatusDesc();

	FNavMeshPath* NavMeshPath = Path.IsValid() ? Path->CastPath<FNavMeshPath>() : NULL;
	FAbstractNavigationPath* DirectPath = Path.IsValid() ? Path->CastPath<FAbstractNavigationPath>() : NULL;

	if (Status == EPathFollowingStatus::Moving)
	{
		StatusDesc += FString::Printf(TEXT(" [path:%d, visited:%d]"), PathStartIndex, LastPathPolyIndex);
	}

	Category.Add(TEXT("Status"), StatusDesc);
	Category.Add(TEXT("Path"), !Path.IsValid() ? TEXT("none") : NavMeshPath ? TEXT("navmesh") : DirectPath ? TEXT("direct") : TEXT("unknown"));

	UObject* CustomLinkOb = GetCurrentCustomLinkOb();
	if (CustomLinkOb)
	{
		Category.Add(TEXT("SmartLink"), CustomLinkOb->GetName());
	}

	UCrowdManager* Manager = UCrowdManager::GetCurrent(GetWorld());
	if (Manager && !Manager->IsAgentValid(this))
	{
		Category.Add(TEXT("Simulation"), TEXT("unable to register!"));
	}

	Snapshot->Status.Add(Category);
}
开发者ID:mysheng8,项目名称:UnrealEngine,代码行数:43,代码来源:CrowdFollowingComponent.cpp

示例12: GetCommandletName

/**
 * Builds a human readable name from the commandlets name
 *
 * @param Commandlet the commandlet to mangle the name of
 */
static FString GetCommandletName(UCommandlet* Commandlet)
{
	// Don't print out the default portion of the name
	static INT SkipLen = appStrlen(TEXT("Default__"));
	FString Name(*Commandlet->GetName() + SkipLen);
	// Strip off everything past the friendly name
	INT Index = Name.InStr(TEXT("Commandlet"));
	if (Index != -1)
	{
		Name = Name.Left(Index);
	}
	// Get the code package this commandlet is contained in
	UObject* Outer = Commandlet->GetOutermost();
	// Build Package.Commandlet as the name
	FString FullName = Outer->GetName();
	FullName += TEXT(".");
	FullName += Name;
	return FullName;
}
开发者ID:LiuKeHua,项目名称:colorful-engine,代码行数:24,代码来源:UHelpCommandlet.cpp

示例13: GetDisplayValueAsString

FString SPropertyEditorCombo::GetDisplayValueAsString() const
{
	const UProperty* Property = PropertyEditor->GetProperty();
	const UByteProperty* ByteProperty = Cast<const UByteProperty>( Property );
	const bool bStringEnumProperty = Property && Property->IsA(UStrProperty::StaticClass()) && Property->HasMetaData(TEXT("Enum"));	

	if ( !(ByteProperty || bStringEnumProperty) )
	{
		UObject* ObjectValue = NULL;
		FPropertyAccess::Result Result = PropertyEditor->GetPropertyHandle()->GetValue( ObjectValue );

		if( Result == FPropertyAccess::Success && ObjectValue != NULL )
		{
			return ObjectValue->GetName();
		}
	}

	return (bUsesAlternateDisplayValues) ? PropertyEditor->GetValueAsDisplayString() : PropertyEditor->GetValueAsString();
}
开发者ID:JustDo1989,项目名称:UnrealEngine4.11-HairWorks,代码行数:19,代码来源:SPropertyEditorCombo.cpp

示例14: GetNotifyName_Implementation

FString UAnimNotify::GetNotifyName_Implementation() const
{
	UObject* ClassGeneratedBy = GetClass()->ClassGeneratedBy;
	FString NotifyName;

	if(ClassGeneratedBy)
	{
		// GeneratedBy will be valid for blueprint types and gives a clean name without a suffix
		NotifyName = ClassGeneratedBy->GetName();
	}
	else
	{
		// Native notify classes are clean without a suffix otherwise
		NotifyName = GetClass()->GetName();
	}

	NotifyName = NotifyName.Replace(TEXT("AnimNotify_"), TEXT(""), ESearchCase::CaseSensitive);
	
	return NotifyName;
}
开发者ID:WasPedro,项目名称:UnrealEngine4.11-HairWorks,代码行数:20,代码来源:AnimNotify.cpp

示例15: GenerateZConstructor

	// Keep sync with FTypeSingletonCache::GenerateSingletonName
	static FString GenerateZConstructor(UField* Item)
	{
		FString Result;
		if (!ensure(Item))
		{
			return Result;
		}
		
		for (UObject* Outer = Item; Outer; Outer = Outer->GetOuter())
		{
			if (!Result.IsEmpty())
			{
				Result = TEXT("_") + Result;
			}

			if (Cast<UClass>(Outer) || Cast<UScriptStruct>(Outer))
			{
				FString OuterName = FEmitHelper::GetCppName(CastChecked<UField>(Outer), true);
				Result = OuterName + Result;

				// Structs can also have UPackage outer.
				if (Cast<UClass>(Outer) || Cast<UPackage>(Outer->GetOuter()))
				{
					break;
				}
			}
			else
			{
				Result = Outer->GetName() + Result;
			}
		}

		// Can't use long package names in function names.
		if (Result.StartsWith(TEXT("/Script/"), ESearchCase::CaseSensitive))
		{
			Result = FPackageName::GetShortName(Result);
		}

		const FString ClassString = Item->IsA<UClass>() ? TEXT("UClass") : TEXT("UScriptStruct");
		return FString(TEXT("Z_Construct_")) + ClassString + TEXT("_") + Result + TEXT("()");
	}
开发者ID:JustDo1989,项目名称:UnrealEngine4.11-HairWorks,代码行数:42,代码来源:BlueprintCompilerCppBackendValueHelper.cpp


注:本文中的UObject::GetName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。