Clean initial commit
This commit is contained in:
22
Source/ThisWillWork/MyCustomActorFinder.cpp
Normal file
22
Source/ThisWillWork/MyCustomActorFinder.cpp
Normal file
@@ -0,0 +1,22 @@
|
||||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
|
||||
#include "MyCustomActorFinder.h"
|
||||
#include "Engine/World.h"
|
||||
#include "GameFramework/Actor.h"
|
||||
#include "EngineUtils.h"
|
||||
|
||||
AActor* MyCustomActorFinder::FindActorByName(const FString& ActorName)
|
||||
{
|
||||
for (TActorIterator<AActor> It(GetWorld()); It; ++It)
|
||||
{
|
||||
AActor* Actor = *It;
|
||||
if (Actor->GetName() == ActorName)
|
||||
{
|
||||
return Actor;
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user