Clean code
This commit is contained in:
parent
0faebb4965
commit
12323d425b
BIN
Pawn_Unreal/Content/Characters/BP_Judy.uasset
(Stored with Git LFS)
BIN
Pawn_Unreal/Content/Characters/BP_Judy.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Pawn_Unreal/Content/Core/GM_MainGameMode.uasset
(Stored with Git LFS)
BIN
Pawn_Unreal/Content/Core/GM_MainGameMode.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Pawn_Unreal/Content/Input/BP_MainPlayerController.uasset
(Stored with Git LFS)
BIN
Pawn_Unreal/Content/Input/BP_MainPlayerController.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Pawn_Unreal/Content/Maps/Dev/MAP_ControllerGym.umap
(Stored with Git LFS)
BIN
Pawn_Unreal/Content/Maps/Dev/MAP_ControllerGym.umap
(Stored with Git LFS)
Binary file not shown.
BIN
Pawn_Unreal/Content/__ExternalActors__/Maps/Dev/MAP_ControllerGym/3/JJ/2G4XZ4FX8KSV5ISWLBUX9T.uasset
(Stored with Git LFS)
Normal file
BIN
Pawn_Unreal/Content/__ExternalActors__/Maps/Dev/MAP_ControllerGym/3/JJ/2G4XZ4FX8KSV5ISWLBUX9T.uasset
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
Pawn_Unreal/Content/__ExternalActors__/Maps/Dev/MAP_ControllerGym/3/S1/Q0FDQMTTCM0M6RLWXOTPMF.uasset
(Stored with Git LFS)
BIN
Pawn_Unreal/Content/__ExternalActors__/Maps/Dev/MAP_ControllerGym/3/S1/Q0FDQMTTCM0M6RLWXOTPMF.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Pawn_Unreal/Content/__ExternalActors__/Maps/Dev/MAP_ControllerGym/D/11/8KRHTI8SRC72YR9XJOITVN.uasset
(Stored with Git LFS)
BIN
Pawn_Unreal/Content/__ExternalActors__/Maps/Dev/MAP_ControllerGym/D/11/8KRHTI8SRC72YR9XJOITVN.uasset
(Stored with Git LFS)
Binary file not shown.
@ -26,7 +26,7 @@ void UPwnTriggerRegister::UnregisterTrigger(UPwnTrigger* Trigger) {
|
||||
RelevantTrigger = nullptr;
|
||||
}
|
||||
}
|
||||
UE_DISABLE_OPTIMIZATION
|
||||
|
||||
void UPwnTriggerRegister::TickComponent(float DeltaTime, ELevelTick TickType,
|
||||
FActorComponentTickFunction* ThisTickFunction) {
|
||||
UPwnTrigger* BestTrigger = nullptr;
|
||||
@ -34,9 +34,9 @@ void UPwnTriggerRegister::TickComponent(float DeltaTime, ELevelTick TickType,
|
||||
for (UPwnTrigger* PwnTrigger : Triggers) {
|
||||
FVector2D ActorForward = FVector2D(GetOwner()->GetActorForwardVector());
|
||||
FVector2D ActorToTrigger = FVector2D(PwnTrigger->GetVolumeCenter() - GetOwner()->GetActorLocation()).GetSafeNormal();
|
||||
const float Dot = FVector2D::DotProduct(ActorForward, ActorToTrigger);
|
||||
// Check dot product against lowest dot product and check if the actor is facing the trigger
|
||||
|
||||
// Check dot product against lowest dot product and check if the actor is facing the trigger
|
||||
const float Dot = FVector2D::DotProduct(ActorForward, ActorToTrigger);
|
||||
if (Dot < LowestDot && (!PwnTrigger->MustFaceCenter || FMath::RadiansToDegrees(FMath::Acos(Dot)) < PwnTrigger->FaceAngle * 0.5f)) {
|
||||
LowestDot = Dot;
|
||||
BestTrigger = PwnTrigger;
|
||||
@ -54,4 +54,3 @@ void UPwnTriggerRegister::TickComponent(float DeltaTime, ELevelTick TickType,
|
||||
}
|
||||
}
|
||||
}
|
||||
UE_ENABLE_OPTIMIZATION
|
||||
@ -4,7 +4,7 @@
|
||||
#include "Kismet/BlueprintFunctionLibrary.h"
|
||||
#include "PwnGameplayModeLibrary.generated.h"
|
||||
|
||||
UCLASS(DisplayName="Gameplay Mode Library")
|
||||
UCLASS()
|
||||
class PAWN_API UPwnGameplayModeLibrary : public UBlueprintFunctionLibrary {
|
||||
GENERATED_BODY()
|
||||
|
||||
|
||||
@ -11,7 +11,7 @@ enum EInteractionType {
|
||||
Disable,
|
||||
};
|
||||
|
||||
UINTERFACE(BlueprintType, Blueprintable, DisplayName="Interactable")
|
||||
UINTERFACE(BlueprintType, Blueprintable)
|
||||
class PAWN_API UPwnInteractable : public UInterface {
|
||||
GENERATED_BODY()
|
||||
};
|
||||
|
||||
@ -35,7 +35,7 @@ struct FInteractableActions {
|
||||
|
||||
UCLASS(ClassGroup="Interaction",
|
||||
HideCategories=("Cooking", "Replication", "Collision"),
|
||||
meta=(BlueprintSpawnableComponent, DisplayName="Trigger"))
|
||||
meta=(BlueprintSpawnableComponent))
|
||||
class PAWN_API UPwnTrigger : public UActorComponent, public IPwnInteractable {
|
||||
GENERATED_BODY()
|
||||
|
||||
|
||||
@ -10,7 +10,7 @@ class UPwnTrigger;
|
||||
|
||||
UCLASS(ClassGroup="Interaction",
|
||||
HideCategories=("Activation", "Cooking", "Replication", "Collision"),
|
||||
meta=(BlueprintSpawnableComponent, DisplayName="Trigger Register"))
|
||||
meta=(BlueprintSpawnableComponent))
|
||||
class PAWN_API UPwnTriggerRegister : public UActorComponent {
|
||||
GENERATED_BODY()
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user