added commission tracker to HUD
This commit is contained in:
@@ -198,7 +198,7 @@ ENPCType UNPCDirectorSubsystem::PickWeightedClass() const
|
||||
return ENPCType::None;
|
||||
}
|
||||
|
||||
bool UNPCDirectorSubsystem::FindSpawnPoint(const FVector& Around, FVector& OutLocation) const
|
||||
bool UNPCDirectorSubsystem::FindSpawnPoint(const FVector& Around, FVector& OutLocation)
|
||||
{
|
||||
UNavigationSystemV1* NavSys = UNavigationSystemV1::GetCurrent(GetWorld());
|
||||
const UNPCDirectorConfig* Config = GetConfig();
|
||||
@@ -214,7 +214,9 @@ bool UNPCDirectorSubsystem::FindSpawnPoint(const FVector& Around, FVector& OutLo
|
||||
if (NavSys->GetRandomReachablePointInRadius(Around, Config->SpawnRadiusMax, NavLocation) &&
|
||||
FVector::DistSquared(NavLocation.Location, Around) >= MinRadiusSq)
|
||||
{
|
||||
OutLocation = NavLocation.Location;
|
||||
FVector SpawnLocation = NavLocation.Location;
|
||||
CorrectSpawnLocation(SpawnLocation);
|
||||
OutLocation = SpawnLocation;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -227,6 +229,11 @@ TSubclassOf<ANPC> UNPCDirectorSubsystem::GetRandomNPCClass(TArray<TSubclassOf<AN
|
||||
return InNPCClasses[RandomIndex];
|
||||
}
|
||||
|
||||
void UNPCDirectorSubsystem::CorrectSpawnLocation(FVector& OutVector)
|
||||
{
|
||||
OutVector.Z += 50.0f;
|
||||
}
|
||||
|
||||
APawn* UNPCDirectorSubsystem::GetPlayerPawn() const
|
||||
{
|
||||
return UGameplayStatics::GetPlayerPawn(GetWorld(), 0);
|
||||
|
||||
@@ -42,8 +42,9 @@ private:
|
||||
ANPC* TakeFromPool();
|
||||
void ReturnToPool(ANPC* NPC);
|
||||
ENPCType PickWeightedClass() const;
|
||||
bool FindSpawnPoint(const FVector& Around, FVector& OutLocation) const;
|
||||
bool FindSpawnPoint(const FVector& Around, FVector& OutLocation);
|
||||
TSubclassOf<ANPC> GetRandomNPCClass(TArray<TSubclassOf<ANPC>> InNPCClasses);
|
||||
void CorrectSpawnLocation(FVector& OutVector);
|
||||
|
||||
APawn* GetPlayerPawn() const;
|
||||
UNPCDirectorConfig* GetConfig() const;
|
||||
|
||||
Reference in New Issue
Block a user