更新目标对象是物品周围的bug
This commit is contained in:
parent
0cb40e792b
commit
c6f31bb217
BIN
ProjectFish/Binaries/Win64/UnrealEditor-ProjectFish-0001.pdb
Normal file
BIN
ProjectFish/Binaries/Win64/UnrealEditor-ProjectFish-0001.pdb
Normal file
Binary file not shown.
Binary file not shown.
@ -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"
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
@ -4,6 +4,7 @@
|
||||
#include "SkillManager.h"
|
||||
#include "Skill.h"
|
||||
#include "ProjectFish/DataAsset/BagConfigAsset.h"
|
||||
#include "ProjectFish/DataAsset/BagShapeAsset.h"
|
||||
|
||||
void USkillManager::Tick(float DeltaTime)
|
||||
{
|
||||
@ -42,6 +43,7 @@ void USkillManager::AddBagWithSkills(UBagConfigAsset* Bag, APawnWithSkill* Pawn,
|
||||
TArray<FIntPoint>& BagPositions)
|
||||
{
|
||||
FIntPoint BagSize = *PawnInfo.Find(Pawn);
|
||||
TMap<FIntPoint, int32>* states = PawnBagState.Find(Pawn);
|
||||
for (auto PlacedSkill: Bag->PlacedSkills)
|
||||
{
|
||||
USkill* skill = NewObject<USkill>(this);
|
||||
@ -49,6 +51,14 @@ void USkillManager::AddBagWithSkills(UBagConfigAsset* Bag, APawnWithSkill* Pawn,
|
||||
SkillObjects.Add(skill);
|
||||
BagPositions.Add(FIntPoint(PlacedSkill.PositionX, PlacedSkill.PositionY));
|
||||
Skills.Add(skill);
|
||||
//设置占用状态
|
||||
for (int x = 0; x < Bag->BagShapeAsset->BagWidth; x++)
|
||||
{
|
||||
for (int y = 0; y < Bag->BagShapeAsset->BagHeight; y++)
|
||||
{
|
||||
states->Add(FIntPoint(x, y) + FIntPoint(x, y), GetSkillIndex(skill));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -167,3 +177,5 @@ TArray<USkill*> USkillManager::GetSkillsByType(ESkillType SkillType) const
|
||||
}
|
||||
return Result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -62,6 +62,7 @@ public:
|
||||
|
||||
UFUNCTION(BlueprintPure)
|
||||
TArray<class USkill*> GetSkillsByType(ESkillType SkillType) const;
|
||||
|
||||
protected:
|
||||
UPROPERTY(BlueprintReadWrite)
|
||||
TArray<class USkill *> Skills;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user