diff --git a/Source/NakedDesire/InteractionSystem/InteractionManager.cpp b/Source/NakedDesire/InteractionSystem/InteractionManager.cpp deleted file mode 100644 index ea4e23bb..00000000 --- a/Source/NakedDesire/InteractionSystem/InteractionManager.cpp +++ /dev/null @@ -1,41 +0,0 @@ -// © 2025 Naked People Team. All Rights Reserved. - - -#include "InteractionManager.h" -#include "Kismet/GameplayStatics.h" -#include "NakedDesire/Player/NakedDesireCharacter.h" - - -UInteractionManager::UInteractionManager() -{ - PrimaryComponentTick.bCanEverTick = false; -} - -void UInteractionManager::OnTargetEnter(const TScriptInterface& Target) -{ - InteractionTargets.Add(Target); -} - -void UInteractionManager::OnTargetExit(const TScriptInterface& Target) -{ - InteractionTargets.Remove(Target); -} - -TScriptInterface UInteractionManager::GetNearestInteractionTarget() -{ - const ANakedDesireCharacter* Player = Cast(UGameplayStatics::GetPlayerCharacter(GetWorld(), 0)); - TScriptInterface Target; - for (const auto& Elem : InteractionTargets) - { - const AActor* Actor = Cast(Elem.GetObject()); - const AActor* TargetActor = Target ? Cast(Target.GetObject()) : nullptr; - if (!Target || FVector::Distance(Player->GetActorLocation(), Actor->GetActorLocation()) < FVector::Distance(Player->GetActorLocation(), TargetActor->GetActorLocation())) - { - Target = Elem; - } - - } - - return Target; -} - diff --git a/Source/NakedDesire/InteractionSystem/InteractionManager.h b/Source/NakedDesire/InteractionSystem/InteractionManager.h deleted file mode 100644 index a6379858..00000000 --- a/Source/NakedDesire/InteractionSystem/InteractionManager.h +++ /dev/null @@ -1,27 +0,0 @@ -// © 2025 Naked People Team. All Rights Reserved. - -#pragma once - -#include "CoreMinimal.h" -#include "InteractionTarget.h" -#include "Components/ActorComponent.h" -#include "InteractionManager.generated.h" - - -UCLASS(ClassGroup=(Custom), meta=(BlueprintSpawnableComponent)) -class NAKEDDESIRE_API UInteractionManager : public UActorComponent -{ - GENERATED_BODY() - - UPROPERTY() - TArray> InteractionTargets; - -public: - UInteractionManager(); - - void OnTargetEnter(const TScriptInterface& Target); - void OnTargetExit(const TScriptInterface& Target); - - UFUNCTION(BlueprintCallable) - TScriptInterface GetNearestInteractionTarget(); -}; diff --git a/Source/NakedDesire/InteractionSystem/InteractionTarget.cpp b/Source/NakedDesire/InteractionSystem/InteractionTarget.cpp deleted file mode 100644 index a2eba98e..00000000 --- a/Source/NakedDesire/InteractionSystem/InteractionTarget.cpp +++ /dev/null @@ -1,4 +0,0 @@ -// © 2025 Naked People Team. All Rights Reserved. - - -#include "InteractionTarget.h" diff --git a/Source/NakedDesire/InteractionSystem/InteractionTarget.h b/Source/NakedDesire/InteractionSystem/InteractionTarget.h deleted file mode 100644 index 68f6a9a4..00000000 --- a/Source/NakedDesire/InteractionSystem/InteractionTarget.h +++ /dev/null @@ -1,27 +0,0 @@ -// © 2025 Naked People Team. All Rights Reserved. - -#pragma once - -#include "CoreMinimal.h" -#include "UObject/Interface.h" -#include "InteractionTarget.generated.h" - -// This class does not need to be modified. -UINTERFACE(MinimalAPI) -class UInteractionTarget : public UInterface -{ - GENERATED_BODY() -}; - -/** - * - */ -class NAKEDDESIRE_API IInteractionTarget -{ - GENERATED_BODY() - - // Add interface functions to this class. This is the class that will be inherited to implement this interface. -public: - UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category = "Interaction Target") - void Interact(); -};