更新背包配置功能

This commit is contained in:
997146918 2025-09-24 11:00:12 +08:00
parent a235d423b5
commit 81629714f7
10 changed files with 21 additions and 8 deletions

View File

@ -2,7 +2,7 @@
"BuildId": "37670630",
"Modules":
{
"ProjectFish": "UnrealEditor-ProjectFish.dll",
"ProjectFishEditor": "UnrealEditor-ProjectFishEditor.dll"
"ProjectFish": "UnrealEditor-ProjectFish-0001.dll",
"ProjectFishEditor": "UnrealEditor-ProjectFishEditor-0001.dll"
}
}

View File

@ -5,13 +5,22 @@
#include "ProjectFish/DataAsset/BagConfigAsset.h"
void UFishingRodConfigSubsystem::CreatePlayerInventory(class UBagShapeAsset* bagShape)
void UFishingRodConfigSubsystem::CreateFishingRodInventory(class UBagShapeAsset* FishingRodShape, class UBagShapeAsset* PlayerBagShape)
{
inventoryConfig = NewObject<UBagConfigAsset>(this);
inventoryConfig->BagShapeAsset = bagShape;
//鱼竿的技能配置资源
fishingRodInventoryConfig = NewObject<UBagConfigAsset>(this);
fishingRodInventoryConfig->BagShapeAsset = FishingRodShape;
//玩家背包的技能配置资源
playerInventoryConfig = NewObject<UBagConfigAsset>(this);
playerInventoryConfig->BagShapeAsset = PlayerBagShape;
}
UBagConfigAsset* UFishingRodConfigSubsystem::GetFishingRodInventory()
{
return this->inventoryConfig;
return this->fishingRodInventoryConfig;
}
UBagConfigAsset* UFishingRodConfigSubsystem::GetPlayerInventory()
{
return playerInventoryConfig;
}

View File

@ -16,11 +16,15 @@ class PROJECTFISH_API UFishingRodConfigSubsystem : public UGameInstanceSubsystem
public:
UFUNCTION(BlueprintCallable, Category = "PlayerInventorySubsystem")
void CreatePlayerInventory(class UBagShapeAsset* bagShape);
void CreateFishingRodInventory(class UBagShapeAsset* FishingRodShape, class UBagShapeAsset* PlayerBagShape);
UFUNCTION(BlueprintPure, Category = "PlayerInventorySubsystem")
UBagConfigAsset* GetFishingRodInventory();
UFUNCTION(BlueprintPure, Category = "PlayerInventorySubsystem")
UBagConfigAsset* GetPlayerInventory();
private:
UPROPERTY()
class UBagConfigAsset* inventoryConfig = nullptr;
class UBagConfigAsset* fishingRodInventoryConfig = nullptr;
UPROPERTY()
class UBagConfigAsset* playerInventoryConfig = nullptr;
};