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

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 "ProjectFish/Definations.h"
#include "ProjectFish/PawnWithSkill.h"
#include "ProjectFish/Subsystem/FishingRodConfigSubsystem.h"
// 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();
}

View File

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