Update ThrowableInventory type

This commit is contained in:
baz 2023-09-20 01:56:13 +01:00
parent 7cdb9b1c69
commit 60bf490f8a
5 changed files with 15 additions and 6 deletions

BIN
Content/Throwables/Test.uasset (Stored with Git LFS) Normal file

Binary file not shown.

BIN
Content/Throwables/Throww.uasset (Stored with Git LFS) Normal file

Binary file not shown.

BIN
Content/Throwables/reee.uasset (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -214,7 +214,7 @@ void ANakatomiCharacter::OnFire()
OnFired.ExecuteIfBound();
}
AThrowable* ANakatomiCharacter::PopThrowableFromInventory()
TSubclassOf<AThrowable> ANakatomiCharacter::PopThrowableFromInventory()
{
if (ThrowableInventory.Num() > 0)
{
@ -224,7 +224,7 @@ AThrowable* ANakatomiCharacter::PopThrowableFromInventory()
return {};
}
void ANakatomiCharacter::PushThrowableToInventory(AThrowable* Throwable)
void ANakatomiCharacter::PushThrowableToInventory(TSubclassOf<AThrowable> Throwable)
{
if (ThrowableInventory.Num() < MaximumThrowableInventorySize)
{

View File

@ -35,8 +35,8 @@ public:
UPROPERTY()
AWeapon* CurrentWeapon = nullptr;
UPROPERTY()
TArray<AThrowable*> ThrowableInventory;
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite)
TArray<TSubclassOf<AThrowable>> ThrowableInventory;
private:
UPROPERTY(VisibleDefaultsOnly)
@ -94,9 +94,9 @@ public:
virtual void OnFire();
AThrowable* PopThrowableFromInventory();
TSubclassOf<AThrowable> PopThrowableFromInventory();
void PushThrowableToInventory(AThrowable* Throwable);
void PushThrowableToInventory(TSubclassOf<AThrowable> Throwable);
protected:
virtual void CalculateHits(TArray<FHitResult>* hits);