更新玩家背包默认使用的配置资源

This commit is contained in:
997146918 2025-09-25 16:22:16 +08:00
parent 430b533c7e
commit 6677b285b8
6 changed files with 5 additions and 4 deletions

View File

@ -6,14 +6,15 @@
#include "ProjectFish/DataAsset/BagConfigAsset.h"
#include "ProjectFish/DataAsset/BagShapeAsset.h"
void UFishingRodConfigSubsystem::CreateFishingRodInventory(class UBagShapeAsset* FishingRodShape, class UBagShapeAsset* PlayerBagShape)
void UFishingRodConfigSubsystem::CreateFishingRodInventory(class UBagShapeAsset* FishingRodShape, class UBagConfigAsset* PlayerBagConfig)
{
//鱼竿的技能配置资源
fishingRodInventoryConfig = NewObject<UBagConfigAsset>(this);
fishingRodInventoryConfig->BagShapeAsset = FishingRodShape;
//玩家背包的技能配置资源
playerInventoryConfig = NewObject<UBagConfigAsset>(this);
playerInventoryConfig->BagShapeAsset = PlayerBagShape;
// playerInventoryConfig = NewObject<UBagConfigAsset>(this);
// playerInventoryConfig->BagShapeAsset = PlayerBagShape;
playerInventoryConfig = DuplicateObject<UBagConfigAsset>(PlayerBagConfig, this);
}
UBagConfigAsset* UFishingRodConfigSubsystem::GetFishingRodInventory()

View File

@ -17,7 +17,7 @@ class PROJECTFISH_API UFishingRodConfigSubsystem : public UGameInstanceSubsystem
public:
UFUNCTION(BlueprintCallable, Category = "PlayerInventorySubsystem")
void CreateFishingRodInventory(class UBagShapeAsset* FishingRodShape, class UBagShapeAsset* PlayerBagShape);
void CreateFishingRodInventory(class UBagShapeAsset* FishingRodShape, class UBagConfigAsset* PlayerBagConfig);
UFUNCTION(BlueprintPure, Category = "PlayerInventorySubsystem")
UBagConfigAsset* GetFishingRodInventory();