添加发现新的鱼 ui信息
This commit is contained in:
parent
220ea3a481
commit
0513ccc3d7
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -48,4 +48,8 @@ public:
|
|||||||
// 任务存档数据
|
// 任务存档数据
|
||||||
UPROPERTY(SaveGame, BlueprintReadWrite, meta = (ToolTip = "任务存档数据"))
|
UPROPERTY(SaveGame, BlueprintReadWrite, meta = (ToolTip = "任务存档数据"))
|
||||||
TArray<FQuestSaveData> QuestSaveData;
|
TArray<FQuestSaveData> QuestSaveData;
|
||||||
|
|
||||||
|
//已战胜的鱼
|
||||||
|
UPROPERTY(SaveGame, BlueprintReadWrite, meta = (ToolTip = "被击败的鱼"))
|
||||||
|
TArray<int32> Fish_defeated_IDS;
|
||||||
};
|
};
|
||||||
|
|||||||
@ -102,3 +102,22 @@ void UGameInfoManager::CreateGameInfoAndSave(UShapeAsset* ShipContainerShape, US
|
|||||||
|
|
||||||
SaveGameInfo();
|
SaveGameInfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool UGameInfoManager::IsFishDefeated(int32 FishID)
|
||||||
|
{
|
||||||
|
if (!IsValid(PlayerInfo))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return PlayerInfo->Fish_defeated_IDS.Contains(FishID);
|
||||||
|
}
|
||||||
|
|
||||||
|
void UGameInfoManager::AddDefeatedFish(int32 FishID)
|
||||||
|
{
|
||||||
|
if (!IsValid(PlayerInfo))
|
||||||
|
{
|
||||||
|
PlayerInfo = NewObject<UPlayerInfoSaveGame>(this);
|
||||||
|
}
|
||||||
|
PlayerInfo->Fish_defeated_IDS.Add(FishID);
|
||||||
|
SaveGameInfo();
|
||||||
|
}
|
||||||
|
|||||||
@ -29,6 +29,12 @@ public:
|
|||||||
|
|
||||||
UFUNCTION(BlueprintCallable)
|
UFUNCTION(BlueprintCallable)
|
||||||
void CreateGameInfoAndSave(UShapeAsset* ShipContainerShape, UShapeAsset* PlayerContainerShape);
|
void CreateGameInfoAndSave(UShapeAsset* ShipContainerShape, UShapeAsset* PlayerContainerShape);
|
||||||
|
|
||||||
|
UFUNCTION(BlueprintPure)
|
||||||
|
bool IsFishDefeated(int32 FishID);
|
||||||
|
|
||||||
|
UFUNCTION(BlueprintCallable)
|
||||||
|
void AddDefeatedFish(int32 FishID);
|
||||||
protected:
|
protected:
|
||||||
UPROPERTY(BlueprintReadOnly)
|
UPROPERTY(BlueprintReadOnly)
|
||||||
TObjectPtr<class UPlayerInfoSaveGame> PlayerInfo;
|
TObjectPtr<class UPlayerInfoSaveGame> PlayerInfo;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user