implemented pick up item
This commit is contained in:
parent
959723df6a
commit
7c5833f033
BIN
hwanyoung2/Content/Hwanyoung/Character/PlayerCharacter/BP_HYPlayerCharacController.uasset
(Stored with Git LFS)
BIN
hwanyoung2/Content/Hwanyoung/Character/PlayerCharacter/BP_HYPlayerCharacController.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
hwanyoung2/Content/Hwanyoung/Character/PlayerCharacter/BP_PlayerCharacterBase.uasset
(Stored with Git LFS)
BIN
hwanyoung2/Content/Hwanyoung/Character/PlayerCharacter/BP_PlayerCharacterBase.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
hwanyoung2/Content/Hwanyoung/Character/PlayerCharacter/Playables/Haesol/NewAnimMontage.uasset
(Stored with Git LFS)
BIN
hwanyoung2/Content/Hwanyoung/Character/PlayerCharacter/Playables/Haesol/NewAnimMontage.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
hwanyoung2/Content/Hwanyoung/Illusions/Assets/Icons/M_FoxMarble.uasset
(Stored with Git LFS)
Normal file
BIN
hwanyoung2/Content/Hwanyoung/Illusions/Assets/Icons/M_FoxMarble.uasset
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
hwanyoung2/Content/Hwanyoung/Illusions/Assets/Meshes/medicine_bowl.uasset
(Stored with Git LFS)
BIN
hwanyoung2/Content/Hwanyoung/Illusions/Assets/Meshes/medicine_bowl.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
hwanyoung2/Content/Hwanyoung/Illusions/GeneralizedBlueprints/AC_AttributeSystem.uasset
(Stored with Git LFS)
BIN
hwanyoung2/Content/Hwanyoung/Illusions/GeneralizedBlueprints/AC_AttributeSystem.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
hwanyoung2/Content/Hwanyoung/Illusions/GeneralizedBlueprints/AC_HPSystem.uasset
(Stored with Git LFS)
BIN
hwanyoung2/Content/Hwanyoung/Illusions/GeneralizedBlueprints/AC_HPSystem.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
hwanyoung2/Content/Hwanyoung/Illusions/GeneralizedBlueprints/AC_MPSystem.uasset
(Stored with Git LFS)
BIN
hwanyoung2/Content/Hwanyoung/Illusions/GeneralizedBlueprints/AC_MPSystem.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
hwanyoung2/Content/Hwanyoung/Illusions/GeneralizedBlueprints/BP_ManualPickUpItemBase.uasset
(Stored with Git LFS)
BIN
hwanyoung2/Content/Hwanyoung/Illusions/GeneralizedBlueprints/BP_ManualPickUpItemBase.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
hwanyoung2/Content/Hwanyoung/Illusions/GeneralizedBlueprints/I_Buffable.uasset
(Stored with Git LFS)
BIN
hwanyoung2/Content/Hwanyoung/Illusions/GeneralizedBlueprints/I_Buffable.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
hwanyoung2/Content/Hwanyoung/Illusions/GeneralizedBlueprints/I_Damagable.uasset
(Stored with Git LFS)
BIN
hwanyoung2/Content/Hwanyoung/Illusions/GeneralizedBlueprints/I_Damagable.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
hwanyoung2/Content/Hwanyoung/Illusions/GeneralizedBlueprints/I_ManaUser.uasset
(Stored with Git LFS)
BIN
hwanyoung2/Content/Hwanyoung/Illusions/GeneralizedBlueprints/I_ManaUser.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
hwanyoung2/Content/Hwanyoung/Illusions/GeneralizedBlueprints/ItemBP/BP_FoxMarble.uasset
(Stored with Git LFS)
BIN
hwanyoung2/Content/Hwanyoung/Illusions/GeneralizedBlueprints/ItemBP/BP_FoxMarble.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
hwanyoung2/Content/Hwanyoung/Illusions/GeneralizedBlueprints/ItemBP/BP_Gochugaru.uasset
(Stored with Git LFS)
BIN
hwanyoung2/Content/Hwanyoung/Illusions/GeneralizedBlueprints/ItemBP/BP_Gochugaru.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
hwanyoung2/Content/Hwanyoung/Illusions/GeneralizedBlueprints/S_AttributeSetInfo.uasset
(Stored with Git LFS)
BIN
hwanyoung2/Content/Hwanyoung/Illusions/GeneralizedBlueprints/S_AttributeSetInfo.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
hwanyoung2/Content/Hwanyoung/Illusions/GeneralizedBlueprints/S_DamageInfo.uasset
(Stored with Git LFS)
BIN
hwanyoung2/Content/Hwanyoung/Illusions/GeneralizedBlueprints/S_DamageInfo.uasset
(Stored with Git LFS)
Binary file not shown.
Binary file not shown.
BIN
hwanyoung2/Content/Hwanyoung/UI/BP_InventoryHUDWidget.uasset
(Stored with Git LFS)
BIN
hwanyoung2/Content/Hwanyoung/UI/BP_InventoryHUDWidget.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
hwanyoung2/Content/Hwanyoung/UI/BP_InventoryWidget.uasset
(Stored with Git LFS)
BIN
hwanyoung2/Content/Hwanyoung/UI/BP_InventoryWidget.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
hwanyoung2/Content/KoreanTraditionalMartialArts/Meshs/Characters/Meshs/SKEL_Soldier_1.uasset
(Stored with Git LFS)
BIN
hwanyoung2/Content/KoreanTraditionalMartialArts/Meshs/Characters/Meshs/SKEL_Soldier_1.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
hwanyoung2/Content/ThirdPerson/Maps/ThirdPersonMap.umap
(Stored with Git LFS)
BIN
hwanyoung2/Content/ThirdPerson/Maps/ThirdPersonMap.umap
(Stored with Git LFS)
Binary file not shown.
BIN
hwanyoung2/Content/__ExternalActors__/ThirdPerson/Maps/ThirdPersonMap/0/8C/DRE9MDZ0125X9A8Q4VUQIL.uasset
(Stored with Git LFS)
BIN
hwanyoung2/Content/__ExternalActors__/ThirdPerson/Maps/ThirdPersonMap/0/8C/DRE9MDZ0125X9A8Q4VUQIL.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
hwanyoung2/Content/__ExternalActors__/ThirdPerson/Maps/ThirdPersonMap/5/KV/9XKGKQSU8KNCJ8GHKMAJWM.uasset
(Stored with Git LFS)
BIN
hwanyoung2/Content/__ExternalActors__/ThirdPerson/Maps/ThirdPersonMap/5/KV/9XKGKQSU8KNCJ8GHKMAJWM.uasset
(Stored with Git LFS)
Binary file not shown.
@ -18,7 +18,7 @@ void AHYInteractableActor::Interact_Implementation(APlayerController* Controller
|
|||||||
|
|
||||||
FString AHYInteractableActor::GetInteractText() const
|
FString AHYInteractableActor::GetInteractText() const
|
||||||
{
|
{
|
||||||
return FString::Printf(TEXT("s%: Press F to %s"), *Name, *Action);
|
return FString::Printf(TEXT("%s: Press F to %s"), *Name, *Action);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Called when the game starts or when spawned
|
// Called when the game starts or when spawned
|
||||||
|
@ -30,7 +30,7 @@ public:
|
|||||||
UPROPERTY(EditDefaultsOnly)
|
UPROPERTY(EditDefaultsOnly)
|
||||||
FString Action;
|
FString Action;
|
||||||
|
|
||||||
UFUNCTION(Blueprintcallable, Category = "Pickup")
|
UFUNCTION(BlueprintCallable, Category = "Pickup")
|
||||||
FString GetInteractText() const;
|
FString GetInteractText() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@ -12,7 +12,7 @@ AHYManualPickUp::AHYManualPickUp()
|
|||||||
ItemID = FName("No ID");
|
ItemID = FName("No ID");
|
||||||
|
|
||||||
Super::Name = "Item";
|
Super::Name = "Item";
|
||||||
Super::Action = "pickup";
|
Super::Action = "Pick up";
|
||||||
}
|
}
|
||||||
|
|
||||||
void AHYManualPickUp::Interact_Implementation(APlayerController* Controller)
|
void AHYManualPickUp::Interact_Implementation(APlayerController* Controller)
|
||||||
|
@ -31,7 +31,7 @@ public:
|
|||||||
UFUNCTION(BlueprintCallable, Category = "Utils")
|
UFUNCTION(BlueprintCallable, Category = "Utils")
|
||||||
bool AddItemToInventoryByID(FName ID);
|
bool AddItemToInventoryByID(FName ID);
|
||||||
|
|
||||||
UPROPERTY(VisibleAnywhere, BlueprintReadWrite)
|
UPROPERTY(BlueprintReadWrite, VisibleAnywhere)
|
||||||
class AHYInteractableActor* CurrentInteractable;
|
class AHYInteractableActor* CurrentInteractable;
|
||||||
|
|
||||||
UPROPERTY(VisibleAnywhere, BlueprintReadWrite)
|
UPROPERTY(VisibleAnywhere, BlueprintReadWrite)
|
||||||
@ -43,14 +43,15 @@ public:
|
|||||||
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
||||||
int32 InventoryWeightLimit;
|
int32 InventoryWeightLimit;
|
||||||
|
|
||||||
|
//interacts with the Interactable objects
|
||||||
|
UFUNCTION(BlueprintCallable, Category = "Utils")
|
||||||
|
void Interact();
|
||||||
|
|
||||||
#pragma endregion
|
#pragma endregion
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
//interacts with the Interactable objects
|
|
||||||
void Interact();
|
|
||||||
|
|
||||||
//abstract function to override in order to
|
//abstract function to override in order to
|
||||||
//bind actions or axis to different input components
|
//bind actions or axis to different input components
|
||||||
virtual void SetupInputComponent() override;
|
virtual void SetupInputComponent() override;
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
#include "CoreMinimal.h"
|
#include "CoreMinimal.h"
|
||||||
#include "GameFramework/Actor.h"
|
#include "GameFramework/Actor.h"
|
||||||
#include "Engine/DataTable.h"
|
#include "Engine/DataTable.h"
|
||||||
|
#include "HYManualPickUp.h"
|
||||||
#include "InventoryItem.generated.h"
|
#include "InventoryItem.generated.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -22,6 +23,9 @@ public:
|
|||||||
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
||||||
FName ItemID;
|
FName ItemID;
|
||||||
|
|
||||||
|
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
||||||
|
TSubclassOf<class AHYManualPickUp> ItemPickup;
|
||||||
|
|
||||||
//name of the item
|
//name of the item
|
||||||
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
||||||
FText ItemName;
|
FText ItemName;
|
||||||
|
@ -2,19 +2,10 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#ifndef _HWANYOUNG2_H__
|
||||||
|
#define _HWANYOUNG2_H__
|
||||||
#include "CoreMinimal.h"
|
#include "CoreMinimal.h"
|
||||||
|
|
||||||
UENUM(BlueprintType)
|
#define COLLISION_INTERACTABLE ECC_GameTraceChannel1;
|
||||||
enum class EAbilityInputID : uint8
|
|
||||||
{
|
#endif
|
||||||
None UMETA(DisplayName = "None"), //no input given
|
|
||||||
Confirm UMETA(DisplayName = "Confirm"),
|
|
||||||
Cancel UMETA(DisplayName = "Cancel"),
|
|
||||||
UseWeapon UMETA(DisplayName = "Use Weapon"), //using melee weapon to attack
|
|
||||||
SwitchWeapon UMETA(DisplayName = "Switch Weapons"), //switching weapons
|
|
||||||
UseActive1 UMETA(DisplayName = "Use Active Skill 1"), //active 1
|
|
||||||
UseActive2 UMETA(DisplayName = "Use Active Skill 2"), //active 2
|
|
||||||
UseActive3 UMETA(DisplayName = "Use Active Skill 3"), //active 3
|
|
||||||
UseUlt UMETA(DisplayName = "Use Ultimate Skill"), //ult
|
|
||||||
PassiveDash UMETA(DisplayName = "Dash") //dash (passive)
|
|
||||||
};
|
|
||||||
|
@ -63,7 +63,7 @@ void Ahwanyoung2Character::CheckForInteractables()
|
|||||||
FHitResult HitResult;
|
FHitResult HitResult;
|
||||||
|
|
||||||
// The range of area the system should check for interactables
|
// The range of area the system should check for interactables
|
||||||
int32 Range = 500; //this can be changed
|
int32 Range = 800; //this can be changed
|
||||||
|
|
||||||
//The start of the trace is the transform of the follow camera
|
//The start of the trace is the transform of the follow camera
|
||||||
FVector StartTrace = FollowCamera->GetComponentLocation();
|
FVector StartTrace = FollowCamera->GetComponentLocation();
|
||||||
@ -80,22 +80,21 @@ void Ahwanyoung2Character::CheckForInteractables()
|
|||||||
//object attached to the character and cast it as player character controller class
|
//object attached to the character and cast it as player character controller class
|
||||||
AHYPlayerCharacController* IController = Cast<AHYPlayerCharacController>(GetController());
|
AHYPlayerCharacController* IController = Cast<AHYPlayerCharacController>(GetController());
|
||||||
|
|
||||||
if (IController) {
|
|
||||||
//Checking if something is hit by the line cast within the range
|
//Checking if something is hit by the line cast within the range
|
||||||
if (GetWorld()->LineTraceSingleByChannel(HitResult, StartTrace, EndTrace,
|
if (GetWorld()->LineTraceSingleByChannel(HitResult, StartTrace, EndTrace,
|
||||||
ECC_Visibility, QueryParams)) {
|
ECC_Visibility, QueryParams)) {
|
||||||
|
|
||||||
//Cast the actor to AInteractable
|
//Cast the actor to AInteractable
|
||||||
AHYInteractableActor* Interactable = Cast<AHYInteractableActor>(HitResult.GetActor());
|
if (AHYInteractableActor* Interactable = Cast<AHYInteractableActor>(HitResult.GetActor())) {
|
||||||
|
|
||||||
if (Interactable) {
|
|
||||||
IController->CurrentInteractable = Interactable;
|
IController->CurrentInteractable = Interactable;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
|
|
||||||
IController->CurrentInteractable = nullptr;
|
IController->CurrentInteractable = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user