• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ FName函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中FName函数的典型用法代码示例。如果您正苦于以下问题:C++ FName函数的具体用法?C++ FName怎么用?C++ FName使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: LOCTEXT

void FMainMenu::FillEditMenu( FMenuBuilder& MenuBuilder, const TSharedRef< FExtender > Extender, const TSharedPtr<FTabManager> TabManager )
{
	MenuBuilder.BeginSection("EditHistory", LOCTEXT("HistoryHeading", "History"));
	{
		struct Local
		{
			/** @return Returns a dynamic text string for Undo that contains the name of the action */
			static FText GetUndoLabelText()
			{
				return FText::Format(LOCTEXT("DynamicUndoLabel", "Undo {0}"), GUnrealEd->Trans->GetUndoContext().Title);
			}

			/** @return Returns a dynamic text string for Redo that contains the name of the action */
			static FText GetRedoLabelText()
			{
				return FText::Format(LOCTEXT("DynamicRedoLabel", "Redo {0}"), GUnrealEd->Trans->GetRedoContext().Title);
			}
		};

		// Undo
		TAttribute<FText> DynamicUndoLabel;
		DynamicUndoLabel.BindStatic(&Local::GetUndoLabelText);
		MenuBuilder.AddMenuEntry( FGenericCommands::Get().Undo, "Undo", DynamicUndoLabel); // TAttribute< FString >::Create( &Local::GetUndoLabelText ) );

		// Redo
		TAttribute< FText > DynamicRedoLabel;
		DynamicRedoLabel.BindStatic( &Local::GetRedoLabelText );
		MenuBuilder.AddMenuEntry(FGenericCommands::Get().Redo, "Redo", DynamicRedoLabel); // TAttribute< FString >::Create( &Local::GetRedoLabelText ) );

		// Show undo history
		MenuBuilder.AddMenuEntry(
			LOCTEXT("UndoHistoryTabTitle", "Undo History"),
			LOCTEXT("UndoHistoryTooltipText", "View the entire undo history."),
			FSlateIcon(FEditorStyle::GetStyleSetName(), "UndoHistory.TabIcon"),
			FUIAction(FExecuteAction::CreateStatic(&FUndoHistoryModule::ExecuteOpenUndoHistory))
			);
	}
	MenuBuilder.EndSection();

	MenuBuilder.BeginSection("EditLocalTabSpawners", LOCTEXT("ConfigurationHeading", "Configuration"));
	{
		if (GetDefault<UEditorExperimentalSettings>()->bToolbarCustomization)
		{
			FUIAction ToggleMultiBoxEditMode(
				FExecuteAction::CreateStatic(&FMultiBoxSettings::ToggleToolbarEditing),
				FCanExecuteAction(),
				FIsActionChecked::CreateStatic(&FMultiBoxSettings::IsInToolbarEditMode)
			);
		
			MenuBuilder.AddMenuEntry(
				LOCTEXT("EditToolbarsLabel", "Edit Toolbars"),
				LOCTEXT("EditToolbarsToolTip", "Allows customization of each toolbar"),
				FSlateIcon(),
				ToggleMultiBoxEditMode,
				NAME_None,
				EUserInterfaceActionType::ToggleButton
			);

			// Automatically populate tab spawners from TabManager
			if (TabManager.IsValid())
			{
				const IWorkspaceMenuStructure& MenuStructure = WorkspaceMenu::GetMenuStructure();
				TabManager->PopulateTabSpawnerMenu(MenuBuilder, MenuStructure.GetEditOptions());
			}
		}

		if (GetDefault<UEditorStyleSettings>()->bExpandConfigurationMenus)
		{
			MenuBuilder.AddSubMenu(
				LOCTEXT("EditorPreferencesSubMenuLabel", "Editor Preferences"),
				LOCTEXT("EditorPreferencesSubMenuToolTip", "Configure the behavior and features of this Editor"),
				FNewMenuDelegate::CreateStatic(&FSettingsMenu::MakeMenu, FName("Editor")),
				false,
				FSlateIcon(FEditorStyle::GetStyleSetName(), "EditorPreferences.TabIcon")
			);

			MenuBuilder.AddSubMenu(
				LOCTEXT("ProjectSettingsSubMenuLabel", "Project Settings"),
				LOCTEXT("ProjectSettingsSubMenuToolTip", "Change the settings of the currently loaded project"),
				FNewMenuDelegate::CreateStatic(&FSettingsMenu::MakeMenu, FName("Project")),
				false,
				FSlateIcon(FEditorStyle::GetStyleSetName(), "ProjectSettings.TabIcon")
			);
		}
		else
		{
#if !PLATFORM_MAC // Handled by app's menu in menu bar
			MenuBuilder.AddMenuEntry(
				LOCTEXT("EditorPreferencesMenuLabel", "Editor Preferences..."),
				LOCTEXT("EditorPreferencesMenuToolTip", "Configure the behavior and features of the Unreal Editor."),
				FSlateIcon(FEditorStyle::GetStyleSetName(), "EditorPreferences.TabIcon"),
				FUIAction(FExecuteAction::CreateStatic(&FSettingsMenu::OpenSettings, FName("Editor"), FName("General"), FName("Appearance")))
			);
#endif

			MenuBuilder.AddMenuEntry(
				LOCTEXT("ProjectSettingsMenuLabel", "Project Settings..."),
				LOCTEXT("ProjectSettingsMenuToolTip", "Change the settings of the currently loaded project."),
				FSlateIcon(FEditorStyle::GetStyleSetName(), "ProjectSettings.TabIcon"),
				FUIAction(FExecuteAction::CreateStatic(&FSettingsMenu::OpenSettings, FName("Project"), FName("Project"), FName("General")))
//.........这里部分代码省略.........
开发者ID:ErwinT6,项目名称:T6Engine,代码行数:101,代码来源:MainMenu.cpp


示例2: Z_Construct_UPackage_TheBeginning

	UPackage* Z_Construct_UPackage_TheBeginning()
	{
		static UPackage* ReturnPackage = NULL;
		if (!ReturnPackage)
		{
			ReturnPackage = CastChecked<UPackage>(StaticFindObjectFast(UPackage::StaticClass(), NULL, FName(TEXT("/Script/TheBeginning")), false, false));
			ReturnPackage->PackageFlags |= PKG_CompiledIn | 0x00000000;
			FGuid Guid;
			Guid.A = 0xAF7F2495;
			Guid.B = 0x2BE2AF11;
			Guid.C = 0x00000000;
			Guid.D = 0x00000000;
			ReturnPackage->SetGuid(Guid);

		}
		return ReturnPackage;
	}
开发者ID:dschmidl,项目名称:GE_Project,代码行数:17,代码来源:TheBeginning.generated.cpp


示例3: FName

// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.

/*=============================================================================
	Interaction.cpp: See .UC for for info
=============================================================================*/

#include "EnginePrivate.h"
#include "Engine/Console.h"
#include "Engine/LevelScriptActor.h"
#include "Slate.h"
#include "DefaultValueHelper.h"

static const uint32 MAX_AUTOCOMPLETION_LINES = 20;

static FName NAME_Typing = FName(TEXT("Typing"));
static FName NAME_Open = FName(TEXT("Open"));

class FConsoleVariableAutoCompleteVisitor 
{
public:
	// @param Name must not be 0
	// @param CVar must not be 0
	static void OnConsoleVariable(const TCHAR *Name, IConsoleObject* CVar,TArray<struct FAutoCompleteCommand>& Sink)
	{
#if (UE_BUILD_SHIPPING || UE_BUILD_TEST)
		if(CVar->TestFlags(ECVF_Cheat))
		{
			return;
		}
#endif // (UE_BUILD_SHIPPING || UE_BUILD_TEST)
		if(CVar->TestFlags(ECVF_Unregistered))
开发者ID:1vanK,项目名称:AHRUnrealEngine,代码行数:31,代码来源:Console.cpp


示例4: FName

#include "GraphEditor.h"

#include "TileMapEditorViewportClient.h"
#include "TileMapEditorCommands.h"
#include "SEditorViewport.h"
#include "WorkspaceMenuStructureModule.h"
#include "Paper2DEditorModule.h"
#include "STileMapEditorViewportToolbar.h"
#include "SDockTab.h"
#include "EdModeTileMap.h"

#define LOCTEXT_NAMESPACE "TileMapEditor"

//////////////////////////////////////////////////////////////////////////

const FName TileMapEditorAppName = FName(TEXT("TileMapEditorApp"));

//////////////////////////////////////////////////////////////////////////

struct FTileMapEditorTabs
{
	// Tab identifiers
	static const FName DetailsID;
	static const FName ViewportID;
	static const FName ToolboxHostID;
};

//////////////////////////////////////////////////////////////////////////

const FName FTileMapEditorTabs::DetailsID(TEXT("Details"));
const FName FTileMapEditorTabs::ViewportID(TEXT("Viewport"));
开发者ID:Codermay,项目名称:Unreal4,代码行数:31,代码来源:TileMapEditor.cpp


示例5: FName

TSharedRef<SWidget> FDetailWidgetExtensionHandler::GenerateExtensionWidget(const UClass* InObjectClass, TSharedPtr<IPropertyHandle> InPropertyHandle)
{
	UProperty* Property = InPropertyHandle->GetProperty();
	FString DelegateName = Property->GetName() + "Delegate";
	
	UDelegateProperty* DelegateProperty = FindFieldChecked<UDelegateProperty>(CastChecked<UClass>(Property->GetOuter()), FName(*DelegateName));

	const bool bIsEditable = Property->HasAnyPropertyFlags(CPF_Edit | CPF_EditConst);
	const bool bDoSignaturesMatch = DelegateProperty->SignatureFunction->GetReturnProperty()->SameType(Property);

	if ( !ensure(bIsEditable && bDoSignaturesMatch) )
	{
		return SNullWidget::NullWidget;
	}

	return SNew(SPropertyBinding, BlueprintEditor.Pin().ToSharedRef(), DelegateProperty, InPropertyHandle.ToSharedRef())
		.GeneratePureBindings(true);
}
开发者ID:RandomDeveloperM,项目名称:UE4_Hairworks,代码行数:18,代码来源:DetailWidgetExtensionHandler.cpp


示例6: FName

FName FMediaPlaylistEditorToolkit::GetToolkitFName() const
{
	return FName("MediaPlaylistEditor");
}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:4,代码来源:MediaPlaylistEditorToolkit.cpp


示例7: Super

AOnlineBeaconHost::AOnlineBeaconHost(const FObjectInitializer& ObjectInitializer) :
	Super(ObjectInitializer)
{
	NetDriverName = FName(TEXT("BeaconDriverHost"));
}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:5,代码来源:OnlineBeaconHost.cpp


示例8: FName

TArray<FRichCurveEditInfo> UCurveFloat::GetCurves()
{
	TArray<FRichCurveEditInfo> Curves;
	Curves.Add(FRichCurveEditInfo(&FloatCurve, FName(*GetName())));
	return Curves;
}
开发者ID:ErwinT6,项目名称:T6Engine,代码行数:6,代码来源:CurveFloat.cpp


示例9: FName

FName UBTComposite_SimpleParallel::GetNodeIconName() const
{
	return FName("BTEditor.Graph.BTNode.Composite.SimpleParallel.Icon");
}
开发者ID:RandomDeveloperM,项目名称:UE4_Hairworks,代码行数:4,代码来源:BTComposite_SimpleParallel.cpp


示例10: LOCTEXT

bool FModuleDescriptor::Read(const FJsonObject& Object, FText& OutFailReason)
{
	// Read the module name
	TSharedPtr<FJsonValue> NameValue = Object.TryGetField(TEXT("Name"));
	if(!NameValue.IsValid() || NameValue->Type != EJson::String)
	{
		OutFailReason = LOCTEXT("ModuleWithoutAName", "Found a 'Module' entry with a missing 'Name' field");
		return false;
	}
	Name = FName(*NameValue->AsString());

	// Read the module type
	TSharedPtr<FJsonValue> TypeValue = Object.TryGetField(TEXT("Type"));
	if(!TypeValue.IsValid() || TypeValue->Type != EJson::String)
	{
		OutFailReason = FText::Format( LOCTEXT( "ModuleWithoutAType", "Found Module entry '{0}' with a missing 'Type' field" ), FText::FromName(Name) );
		return false;
	}
	Type = EHostType::FromString(*TypeValue->AsString());
	if(Type == EHostType::Max)
	{
		OutFailReason = FText::Format( LOCTEXT( "ModuleWithInvalidType", "Module entry '{0}' specified an unrecognized module Type '{1}'" ), FText::FromName(Name), FText::FromString(TypeValue->AsString()) );
		return false;
	}

	// Read the loading phase
	TSharedPtr<FJsonValue> LoadingPhaseValue = Object.TryGetField(TEXT("LoadingPhase"));
	if(LoadingPhaseValue.IsValid() && LoadingPhaseValue->Type == EJson::String)
	{
		LoadingPhase = ELoadingPhase::FromString(*LoadingPhaseValue->AsString());
		if(LoadingPhase == ELoadingPhase::Max)
		{
			OutFailReason = FText::Format( LOCTEXT( "ModuleWithInvalidLoadingPhase", "Module entry '{0}' specified an unrecognized module LoadingPhase '{1}'" ), FText::FromName(Name), FText::FromString(LoadingPhaseValue->AsString()) );
			return false;
		}
	}

	// Read the whitelisted platforms
	TSharedPtr<FJsonValue> WhitelistPlatformsValue = Object.TryGetField(TEXT("WhitelistPlatforms"));
	if(WhitelistPlatformsValue.IsValid() && WhitelistPlatformsValue->Type == EJson::Array)
	{
		const TArray< TSharedPtr< FJsonValue > >& PlatformsArray = WhitelistPlatformsValue->AsArray();
		for(int Idx = 0; Idx < PlatformsArray.Num(); Idx++)
		{
			WhitelistPlatforms.Add(PlatformsArray[Idx]->AsString());
		}
	}

	// Read the blacklisted platforms
	TSharedPtr<FJsonValue> BlacklistPlatformsValue = Object.TryGetField(TEXT("BlacklistPlatforms"));
	if(BlacklistPlatformsValue.IsValid() && BlacklistPlatformsValue->Type == EJson::Array)
	{
		const TArray< TSharedPtr< FJsonValue > >& PlatformsArray = BlacklistPlatformsValue->AsArray();
		for(int Idx = 0; Idx < PlatformsArray.Num(); Idx++)
		{
			BlacklistPlatforms.Add(PlatformsArray[Idx]->AsString());
		}
	}

	return true;
}
开发者ID:1vanK,项目名称:AHRUnrealEngine,代码行数:61,代码来源:ModuleDescriptor.cpp


示例11: ShaderFormatToLegacyShaderPlatform

FNullDynamicRHI::FNullDynamicRHI()
{
	GMaxRHIShaderPlatform = ShaderFormatToLegacyShaderPlatform(FName(FPlatformMisc::GetNullRHIShaderFormat()));
}
开发者ID:RandomDeveloperM,项目名称:UE4_Hairworks,代码行数:4,代码来源:NullRHI.cpp


示例12: LOCTEXT

void CreatureEditor::StartupModule()
{
	FPropertyEditorModule& PropertyModule = FModuleManager::LoadModuleChecked<FPropertyEditorModule>("PropertyEditor");

	//Custom detail views
	PropertyModule.RegisterCustomClassLayout("CreatureAnimStateMachine", FOnGetDetailCustomizationInstance::CreateStatic(&FCreatureAnimStateMachineDetails::MakeInstance));
	PropertyModule.RegisterCustomClassLayout("CreatureMeshComponent", FOnGetDetailCustomizationInstance::CreateStatic(&FCreatureToolsDetails::MakeInstance));

	IAssetTools& AssetTools = FModuleManager::LoadModuleChecked<FAssetToolsModule>("AssetTools").Get();
	EAssetTypeCategories::Type CreatureAssetCategoryBit = AssetTools.RegisterAdvancedAssetCategory(FName(TEXT("CreatureAssetCategory")), LOCTEXT("CreatureAssetCategory", "Creature"));

	AssetTools.RegisterAssetTypeActions(MakeShareable(new FCreatureAnimStateMachineAssetTypeActions(CreatureAssetCategoryBit)));
	AssetTools.RegisterAssetTypeActions(MakeShareable(new FCreatureAnimStoreAssetTypeActions(CreatureAssetCategoryBit)));
	AssetTools.RegisterAssetTypeActions(MakeShareable(new FCreatureAnimationAssetTypeActions(CreatureAssetCategoryBit)));
	AssetTools.RegisterAssetTypeActions(MakeShareable(new FCreatureMetaAssetTypeActions(CreatureAssetCategoryBit)));
	AssetTools.RegisterAssetTypeActions(MakeShareable(new FCreatureParticlesAssetTypeActions(CreatureAssetCategoryBit)));
}
开发者ID:kestrelm,项目名称:Creature_UE4,代码行数:17,代码来源:CreatureEditor.cpp


示例13: FName

void ANextLevelTrigger::BeginOverlap(AActor *Other, class UPrimitiveComponent *OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult &SweepResult)
{
	UGameplayStatics::OpenLevel(GetWorld(), FName(*("/Game/Maps/" + NextLevel.ToString())));
}
开发者ID:krazzei,项目名称:ggj16_slamjam,代码行数:4,代码来源:NextLevelTrigger.cpp


示例14: ShouldCache

	/**
	 * Should the shader for this material with the given platform, shader type and vertex 
	 * factory type combination be compiled
	 *
	 * @param Platform		The platform currently being compiled for
	 * @param ShaderType	Which shader is being compiled
	 * @param VertexFactory	Which vertex factory is being compiled (can be NULL)
	 *
	 * @return true if the shader should be compiled
	 */
	virtual bool ShouldCache(EShaderPlatform Platform, const FShaderType* ShaderType, const FVertexFactoryType* VertexFactoryType) const
	{
		// only generate the needed shaders (which should be very restrictive for fast recompiling during editing)
		// @todo: Add a FindShaderType by fname or something

		bool bEditorStatsMaterial = Material->bIsMaterialEditorStatsMaterial;

		// Always allow HitProxy shaders.
		if (FCString::Stristr(ShaderType->GetName(), TEXT("HitProxy")))
		{
			return true;
		}

		// we only need local vertex factory for the preview static mesh
		if (VertexFactoryType != FindVertexFactoryType(FName(TEXT("FLocalVertexFactory"), FNAME_Find)))
		{
			//cache for gpu skinned vertex factory if the material allows it
			//this way we can have a preview skeletal mesh
			if (bEditorStatsMaterial ||
				!IsUsedWithSkeletalMesh() ||
				(VertexFactoryType != FindVertexFactoryType(FName(TEXT("TGPUSkinVertexFactoryfalse"), FNAME_Find)) &&
				VertexFactoryType != FindVertexFactoryType(FName(TEXT("TGPUSkinVertexFactorytrue"), FNAME_Find))))
			{
				return false;
			}
		}

		if (bEditorStatsMaterial)
		{
			TArray<FString> ShaderTypeNames;
			TArray<FString> ShaderTypeDescriptions;
			GetRepresentativeShaderTypesAndDescriptions(ShaderTypeNames, ShaderTypeDescriptions);

			//Only allow shaders that are used in the stats.
			return ShaderTypeNames.Find(ShaderType->GetName()) != INDEX_NONE;
		}

		// look for any of the needed type
		bool bShaderTypeMatches = false;

		// For FMaterialResource::GetRepresentativeInstructionCounts
		if (FCString::Stristr(ShaderType->GetName(), TEXT("BasePassPSTDistanceFieldShadowsAndLightMapPolicyHQ")))
		{
			bShaderTypeMatches = true;
		}
		else if (FCString::Stristr(ShaderType->GetName(), TEXT("BasePassPSFNoLightMapPolicy")))
		{
			bShaderTypeMatches = true;
		}
		else if (FCString::Stristr(ShaderType->GetName(), TEXT("CachedPointIndirectLightingPolicy")))
		{
			bShaderTypeMatches = true;
		}
		else if (FCString::Stristr(ShaderType->GetName(), TEXT("BasePassPSFSelfShadowedTranslucencyPolicy")))
		{
			bShaderTypeMatches = true;
		}
		// Pick tessellation shader based on material settings
		else if(FCString::Stristr(ShaderType->GetName(), TEXT("BasePassVSFNoLightMapPolicy")) ||
			FCString::Stristr(ShaderType->GetName(), TEXT("BasePassHSFNoLightMapPolicy")) ||
			FCString::Stristr(ShaderType->GetName(), TEXT("BasePassDSFNoLightMapPolicy")))
		{
			bShaderTypeMatches = true;
		}
		else if (FCString::Stristr(ShaderType->GetName(), TEXT("DepthOnly")))
		{
			bShaderTypeMatches = true;
		}
		else if (FCString::Stristr(ShaderType->GetName(), TEXT("ShadowDepth")))
		{
			bShaderTypeMatches = true;
		}
		else if (FCString::Stristr(ShaderType->GetName(), TEXT("TDistortion")))
		{
			bShaderTypeMatches = true;
		}
		else if (FCString::Stristr(ShaderType->GetName(), TEXT("TBasePassForForwardShading")))
		{
			bShaderTypeMatches = true;
		}

		return bShaderTypeMatches;
	}
开发者ID:kidaa,项目名称:UnrealEngineVR,代码行数:93,代码来源:PreviewMaterial.cpp


示例15: FName

FName UBTDecorator_TimeLimit::GetNodeIconName() const
{
	return FName("BTEditor.Graph.BTNode.Decorator.TimeLimit.Icon");
}
开发者ID:Foreven,项目名称:Unreal4-1,代码行数:4,代码来源:BTDecorator_TimeLimit.cpp


示例16: pack

	struct FASTCHeader
	{
		uint32 Magic;
		uint8  BlockSizeX;
		uint8  BlockSizeY;
		uint8  BlockSizeZ;
		uint8  TexelCountX[3];
		uint8  TexelCountY[3];
		uint8  TexelCountZ[3];
	};

#if PLATFORM_SUPPORTS_PRAGMA_PACK
	#pragma pack(pop)
#endif

IImageWrapperModule& ImageWrapperModule = FModuleManager::LoadModuleChecked<IImageWrapperModule>(FName("ImageWrapper"));


static int32 GetDefaultCompressionBySizeValue()
{
	// start at default quality, then lookup in .ini file
	int32 CompressionModeValue = 0;
	GConfig->GetInt(TEXT("/Script/UnrealEd.CookerSettings"), TEXT("DefaultASTCQualityBySize"), CompressionModeValue, GEngineIni);
	
	FParse::Value(FCommandLine::Get(), TEXT("-astcqualitybysize="), CompressionModeValue);
	CompressionModeValue = FMath::Min<uint32>(CompressionModeValue, MAX_QUALITY_BY_SIZE);
	
	return CompressionModeValue;
}

static int32 GetDefaultCompressionBySpeedValue()
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:31,代码来源:TextureFormatASTC.cpp


示例17: GetWorld

void UBrainLevelSelectionMenuWidget::LoadLevel(FString name)
{
	UWorld* world = GetWorld();
	if (world)
		UGameplayStatics::OpenLevel(world,FName(*name));
}
开发者ID:gamer08,项目名称:Brain,代码行数:6,代码来源:BrainLevelSelectionMenuWidget.cpp


示例18: GetActorLocation

void ARayCastCharacter::ThrowRay()
{
	//GEngine->AddOnScreenDebugMessage(-1, 1.0f, FColor::Green, "Throw Ray Cast");

	// Âû÷èñëÿåì êîíåö íàøåãî ëó÷à
	FVector TraceEnd = GetActorLocation() + GetActorForwardVector()*RayDistance;

	// Èíèöàëèçèðóåì ñòðóêòóðó, êîòîðàÿ ïîñëå ñòîëêíîâåíèÿ áóäåò õðàíèòü äàííûå î ñòîëêíîâåíèè
	FHitResult TraceHit;

	// Ïàðàìåòðû äëÿ ðýé êàñòèíãà
	FCollisionQueryParams TraceParams(FName("Ray Cast"), true, this);

	// Îáû÷íûé ðýé êàñò ïî òðåéñ êàíàëó, êîòîðûé îñòàíîâèòñÿ, êîãäà âñòðåòèò õîòÿ á îäíî ïðåïÿòñòâèå
	GetWorld()->LineTraceSingleByChannel(
		TraceHit,
		GetActorLocation(),
		TraceEnd,
		COLLISION_TEST_TRACE,
		TraceParams);




	// Èíèöèàëèçàöèÿ òèïîâ îáúåêòîâ, ñ êîòîðûìè ðåéêàñò áóäåò âçàèìîäåéñòâîâàòü
	/*TArray<TEnumAsByte<EObjectTypeQuery>> ObjectTypes;
	ObjectTypes.Add(EObjectTypeQuery(ECC_Pawn));
	ObjectTypes.Add(EObjectTypeQuery(ECC_WorldStatic));
	ObjectTypes.Add(EObjectTypeQuery(ECC_WorldDynamic));
	FCollisionObjectQueryParams ObjectParams(ObjectTypes);

	GetWorld()->LineTraceSingleByObjectType(
	TraceHit,
	GetActorLocation(),
	TraceEnd,
	ObjectParams,
	TraceParams);*/

	/*GetWorld()->SweepSingleByChannel(	// Ðåéêàñò ïðè ïîìîùè ôèçè÷åñêèõ ïðèìèòèâîâ
		TraceHit,
		GetActorLocation(),
		TraceEnd,
		FQuat::Identity,	// äëÿ Ñâèïà íåîáõîäèì Rotation, âûðàæåííûé ÷åðåç FQuat. FQuat::Identity ñàì îïðåäåëÿåò ïîâîðîò íà îñíîâå äâóõ äàííûé òî÷åê. Íî âû òàêæå ìîæåòå óêàçàòü åãî âðó÷íóþ
		COLLISION_TEST_TRACE,
		FCollisionShape::MakeBox(FVector(0, 100, 100)),	// Äåëàåò ôîðìó, ïî êîòîðîé áóäåò äåëàòü ñâèï. Â ýòîé ñòðîêå ýòî - êîðîáêà
		FCollisionShape::MakeSphere(25.0f),	// Çäåñü - ñôåðà
		FCollisionShape::MakeCapsule(50.f, 100.f),	// À òóò - êàïñóëà. Äëÿ Âûçîâà ðåéêàñòà ðàñêîìåíòü òîëüêî îäíó èç ýòèõ òðåõ ñòðî÷åê
		TraceParams);*/




	//TArray<FHitResult> TraceHits;	// Íèæå ïðèâåäåí ðåéêàñò äëÿ ìíîæåñòâåííûõ îáúåêòîâ. Ðàçíèöà â òîì, ÷òî âìåñòî îäíîãî FHitResult, íåîáõîäèìî ïîäàâàòü ìàññèâ èç íèõ

	//GetWorld()->LineTraceMultiByChannel(
	//	TraceHits,
	//	GetActorLocation(),
	//	TraceEnd,
	//	COLLISION_TEST_TRACE,
	//	TraceParams);




	// Îòðèñîâêà íàøåãî ëó÷à
	DrawDebugLine(
		GetWorld(),
		GetActorLocation(),
		TraceEnd,
		FColor::Cyan,
		false,	// áóäåò ëè íàø ëó÷ îòðèñîâûâàòüñÿ ïîñòîÿííî
		3.0f,	// ñêîëüêî âðåìåíè îí áóäåò îòðèñîâûâàòüñÿ
		0,
		5.0f);	// Òîëùèíà ëó÷à. Äîñòóïíà íå äëÿ âñåõ ôóíêöèé

	if (TraceHit.GetActor())	// Ïðîâåðêà, óäàðèëè ëè ìû êàêîãî-ëèáî àêòåðà
	{
		GEngine->AddOnScreenDebugMessage(-1, 1.0f, FColor::Yellow, "YAY!!!");

		/*ARayCastCharacter* Ray = Cast<ARayCastCharacter>(TraceHit.GetActor());

		if (Ray)
		{
		GEngine->AddOnScreenDebugMessage(-1, 5.0f, FColor::Cyan, "It's Ray!!!");
		}*/

		if (TraceHit.GetActor()->GetClass()->ImplementsInterface(ULessonOct28Interface::StaticClass())) 
		// Ïðîâåðêà íà òî, ðåàëèçóåò ëè êëàññ äàííîãî îáúåêòà óêàçàííûé èíòåðôåéñ. 
		// Íåîáõîäèìî åå äåëàòü îáÿçàòåëüíî, áåç íåå êîìïèëÿöèÿ ïðîéäåò, à âîò ïðèëîæåíèå êðàøíåòñÿ.
		{
			ILessonOct28Interface::Execute_Test(TraceHit.GetActor());	//Ïîñëàíèå ñîîáùåíèÿ íà âûïîëíåíèå ôóíêöèè
			// Åñëè ó ìåòîäà âàøåãî åñòü ïàðàìåòðû, â Execute_MethodName íóæíî èõ ïîäàâàòü ñðàçó ïîñëå óêàçàíèÿ àêòåðà äëÿ èñïîëíåíèÿ
			// Íàïðèìåð: ITestInterface::Execute_TestMethod(TestActor, Param1, Param2); Êîëè÷åñòâî ïàðàìåòðîâ çíà÷åíèÿ íå èìååò.
		}


	}
	else
	{
		GEngine->AddOnScreenDebugMessage(-1, 1.0f, FColor::Red, "No hit...");
//.........这里部分代码省略.........
开发者ID:napolinkinpark3r,项目名称:DML_UE4_Course,代码行数:101,代码来源:RayCastCharacter.cpp


示例19: FindOrCreateHandleToObject

void FParticleTrackEditor::AddKeyInternal( float KeyTime, const TArray<UObject*> Objects, bool bTrigger)
{
	for( int32 ObjectIndex = 0; ObjectIndex < Objects.Num(); ++ObjectIndex )
	{
		UObject* Object = Objects[ObjectIndex];

		FGuid ObjectHandle = FindOrCreateHandleToObject( Object );
		if (ObjectHandle.IsValid())
		{
			UMovieSceneTrack* Track = GetTrackForObject( ObjectHandle, UMovieSceneParticleTrack::StaticClass(), FName("ParticleSystem"));

			if (ensure(Track))
			{
				Cast<UMovieSceneParticleTrack>(Track)->AddNewParticleSystem( KeyTime, bTrigger );
			}
		}
	}
}
开发者ID:Codermay,项目名称:Unreal4,代码行数:18,代码来源:ParticleTrackEditor.cpp


示例20: DestroySocketSubsystem

void DestroySocketSubsystem( FSocketSubsystemModule& SocketSubsystemModule )
{
	SocketSubsystemModule.UnregisterSocketSubsystem(FName(TEXT("LINUX")));
	FSocketSubsystemLinux::Destroy();
}
开发者ID:amyvmiwei,项目名称:UnrealEngine4,代码行数:5,代码来源:SocketSubsystemLinux.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ FOFS函数代码示例发布时间:2022-05-30
下一篇:
C++ FN函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap