Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Fill out your copyright notice in the Description page of Project Settings.
- #pragma once
- #include "CoreMinimal.h"
- #include "Items/Item.h"
- #include "Weapon.generated.h"
- class USoundBase;
- class UBoxComponent;
- UCLASS()
- class SLASH_API AWeapon : public AItem
- {
- GENERATED_BODY()
- public:
- AWeapon();
- void Equip(USceneComponent* InParent, FName InSocketName);
- void AttachMeshToSocket(USceneComponent* InParent, const FName& InSocketName);
- TArray<AActor*> IgnoreActors;
- UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "BpIsOverlaped", meta = (AllowPrivateAccess = "true"))
- bool bIsInOverlap;
- protected:
- virtual void BeginPlay() override;
- virtual void OnSphereOverlap(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult) override;
- virtual void OnSphereEndOverlap(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex) override;
- UFUNCTION()
- void OnBoxOverlap(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult);
- UFUNCTION(BlueprintImplementableEvent)
- void CreateFields(const FVector& FieldLocation);
- private:
- UPROPERTY(EditAnywhere, Category = "Weapon Properties")
- USoundBase* EquipSound;
- UPROPERTY(EditAnywhere, Category = "Weapon Properties")
- UBoxComponent* WeaponBox;
- UPROPERTY(EditAnywhere)
- USceneComponent* BoxTraceStart;
- UPROPERTY(EditAnywhere)
- USceneComponent* BoxTraceEnd;
- public:
- FORCEINLINE UBoxComponent* GetWeaponBox() const { return WeaponBox; }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement