[박치영] 추가작업
parent
3e70ac69c0
commit
205538211f
|
@ -1,8 +1,8 @@
|
|||
|
||||
|
||||
[/Script/EngineSettings.GameMapsSettings]
|
||||
GameDefaultMap=/Game/Maps/GameStartupMap.GameStartupMap
|
||||
EditorStartupMap=/Game/Maps/GameStartupMap.GameStartupMap
|
||||
GameDefaultMap=/Game/Maps/MainStageMap.MainStageMap
|
||||
EditorStartupMap=/Game/Maps/MainStageMap.MainStageMap
|
||||
TransitionMap=/Game/Maps/TransitionMap.TransitionMap
|
||||
|
||||
[/Script/WindowsTargetPlatform.WindowsTargetSettings]
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -18,7 +18,7 @@ public:
|
|||
|
||||
protected:
|
||||
virtual void BeginPlay() override;
|
||||
|
||||
|
||||
public:
|
||||
virtual void Tick(float DeltaTime) override;
|
||||
virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override;
|
||||
|
|
|
@ -3,7 +3,9 @@
|
|||
|
||||
#include "Weapon/Weapon.h"
|
||||
|
||||
#include "Character/D2BaseCharacter.h"
|
||||
#include "Components/SphereComponent.h"
|
||||
#include "Components/WidgetComponent.h"
|
||||
|
||||
AWeapon::AWeapon()
|
||||
{
|
||||
|
@ -23,16 +25,30 @@ AWeapon::AWeapon()
|
|||
AreaSphere->SetCollisionResponseToAllChannels(ECollisionResponse::ECR_Ignore);
|
||||
AreaSphere->SetCollisionEnabled(ECollisionEnabled::NoCollision);
|
||||
|
||||
if(HasAuthority())
|
||||
{
|
||||
AreaSphere->SetCollisionEnabled(ECollisionEnabled::QueryAndPhysics);
|
||||
AreaSphere->SetCollisionResponseToChannel(ECollisionChannel::ECC_Pawn, ECollisionResponse::ECR_Overlap);
|
||||
}
|
||||
PickupWidget = CreateDefaultSubobject<UWidgetComponent>(TEXT("PickupWidget"));
|
||||
PickupWidget->SetupAttachment(RootComponent);
|
||||
}
|
||||
|
||||
void AWeapon::BeginPlay()
|
||||
{
|
||||
Super::BeginPlay();
|
||||
|
||||
if(HasAuthority())
|
||||
{
|
||||
AreaSphere->SetCollisionEnabled(ECollisionEnabled::QueryAndPhysics);
|
||||
AreaSphere->SetCollisionResponseToChannel(ECollisionChannel::ECC_Pawn, ECollisionResponse::ECR_Overlap);
|
||||
AreaSphere->OnComponentBeginOverlap.AddDynamic(this, &AWeapon::OnSphereOverlap);
|
||||
}
|
||||
|
||||
if(PickupWidget)
|
||||
PickupWidget->SetVisibility(false);
|
||||
}
|
||||
|
||||
void AWeapon::OnSphereOverlap(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult)
|
||||
{
|
||||
AD2BaseCharacter* BaseCharacter = Cast<AD2BaseCharacter>(OtherActor);
|
||||
if(BaseCharacter && PickupWidget)
|
||||
PickupWidget->SetVisibility(true);
|
||||
}
|
||||
|
||||
void AWeapon::Tick(float DeltaTime)
|
||||
|
|
|
@ -26,7 +26,9 @@ public:
|
|||
|
||||
protected:
|
||||
virtual void BeginPlay() override;
|
||||
|
||||
UFUNCTION()
|
||||
virtual void OnSphereOverlap(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult);
|
||||
|
||||
public:
|
||||
virtual void Tick(float DeltaTime) override;
|
||||
|
||||
|
@ -37,6 +39,9 @@ private:
|
|||
UPROPERTY(VisibleAnywhere, Category = "Weapon Properties")
|
||||
TObjectPtr<class USphereComponent> AreaSphere;
|
||||
|
||||
UPROPERTY(VisibleAnywhere)
|
||||
UPROPERTY(VisibleAnywhere, Category = "Weapon Properties")
|
||||
EWeaponState WeaponState;
|
||||
|
||||
UPROPERTY(VisibleAnywhere, Category = "Weapon Properties")
|
||||
TObjectPtr<class UWidgetComponent> PickupWidget;
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue