更新目标对象是物品周围的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",
|
"BuildId": "37670630",
|
||||||
"Modules":
|
"Modules":
|
||||||
{
|
{
|
||||||
"ProjectFish": "UnrealEditor-ProjectFish.dll",
|
"ProjectFish": "UnrealEditor-ProjectFish-0001.dll",
|
||||||
"ProjectFishEditor": "UnrealEditor-ProjectFishEditor.dll"
|
"ProjectFishEditor": "UnrealEditor-ProjectFishEditor-0001.dll"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Binary file not shown.
Binary file not shown.
@ -4,6 +4,7 @@
|
|||||||
#include "SkillManager.h"
|
#include "SkillManager.h"
|
||||||
#include "Skill.h"
|
#include "Skill.h"
|
||||||
#include "ProjectFish/DataAsset/BagConfigAsset.h"
|
#include "ProjectFish/DataAsset/BagConfigAsset.h"
|
||||||
|
#include "ProjectFish/DataAsset/BagShapeAsset.h"
|
||||||
|
|
||||||
void USkillManager::Tick(float DeltaTime)
|
void USkillManager::Tick(float DeltaTime)
|
||||||
{
|
{
|
||||||
@ -42,6 +43,7 @@ void USkillManager::AddBagWithSkills(UBagConfigAsset* Bag, APawnWithSkill* Pawn,
|
|||||||
TArray<FIntPoint>& BagPositions)
|
TArray<FIntPoint>& BagPositions)
|
||||||
{
|
{
|
||||||
FIntPoint BagSize = *PawnInfo.Find(Pawn);
|
FIntPoint BagSize = *PawnInfo.Find(Pawn);
|
||||||
|
TMap<FIntPoint, int32>* states = PawnBagState.Find(Pawn);
|
||||||
for (auto PlacedSkill: Bag->PlacedSkills)
|
for (auto PlacedSkill: Bag->PlacedSkills)
|
||||||
{
|
{
|
||||||
USkill* skill = NewObject<USkill>(this);
|
USkill* skill = NewObject<USkill>(this);
|
||||||
@ -49,6 +51,14 @@ void USkillManager::AddBagWithSkills(UBagConfigAsset* Bag, APawnWithSkill* Pawn,
|
|||||||
SkillObjects.Add(skill);
|
SkillObjects.Add(skill);
|
||||||
BagPositions.Add(FIntPoint(PlacedSkill.PositionX, PlacedSkill.PositionY));
|
BagPositions.Add(FIntPoint(PlacedSkill.PositionX, PlacedSkill.PositionY));
|
||||||
Skills.Add(skill);
|
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;
|
return Result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -62,6 +62,7 @@ public:
|
|||||||
|
|
||||||
UFUNCTION(BlueprintPure)
|
UFUNCTION(BlueprintPure)
|
||||||
TArray<class USkill*> GetSkillsByType(ESkillType SkillType) const;
|
TArray<class USkill*> GetSkillsByType(ESkillType SkillType) const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
UPROPERTY(BlueprintReadWrite)
|
UPROPERTY(BlueprintReadWrite)
|
||||||
TArray<class USkill *> Skills;
|
TArray<class USkill *> Skills;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user