更新鱼竿数据的运行时读取

This commit is contained in:
997146918 2025-09-17 17:44:26 +08:00
parent 626fb973e4
commit 7790344f1a
3 changed files with 21 additions and 14 deletions

View File

@ -6,6 +6,7 @@
#include "EngineUtils.h" #include "EngineUtils.h"
#include "ProjectFish/Definations.h" #include "ProjectFish/Definations.h"
#include "ProjectFish/PawnWithSkill.h" #include "ProjectFish/PawnWithSkill.h"
#include "ProjectFish/Subsystem/FishingRodConfigSubsystem.h"
// Sets default values for this component's properties // Sets default values for this component's properties
@ -71,8 +72,13 @@ void UFishingRodComponent::BeginPlay()
}); });
} }
//更新鱼竿槽位配置
UWorld* World = GetWorld();
UGameInstance* GameInstance = World->GetGameInstance();
FishRodData.BagConfig = GameInstance->GetSubsystem<UFishingRodConfigSubsystem>()->GetFishingRodInventory();
// ... // ...
Super::BeginPlay(); Super::BeginPlay();
} }

View File

@ -52,6 +52,8 @@ void USkillManager::AddPawn(class APawnWithSkill* Pawn, FIntPoint BagSize)
void USkillManager::AddBagWithSkills(UBagConfigAsset* Bag, APawnWithSkill* Pawn, TArray<USkill*>& SkillObjects, void USkillManager::AddBagWithSkills(UBagConfigAsset* Bag, APawnWithSkill* Pawn, TArray<USkill*>& SkillObjects,
TArray<FIntPoint>& BagPositions) TArray<FIntPoint>& BagPositions)
{
if (IsValid(Bag))
{ {
FIntPoint BagSize = *PawnInfo.Find(Pawn); FIntPoint BagSize = *PawnInfo.Find(Pawn);
TMap<FIntPoint, int32>* states = PawnBagState.Find(Pawn); TMap<FIntPoint, int32>* states = PawnBagState.Find(Pawn);
@ -71,8 +73,7 @@ void USkillManager::AddBagWithSkills(UBagConfigAsset* Bag, APawnWithSkill* Pawn,
} }
} }
} }
}
} }
void USkillManager::OnAllSkillAdded() void USkillManager::OnAllSkillAdded()