修改船舱的存档功能

This commit is contained in:
997146918 2025-10-20 20:37:52 +08:00
parent 4f33cfbd32
commit 2c6e4f2a89
9 changed files with 18 additions and 5 deletions

View File

@ -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.

View File

@ -2,6 +2,6 @@
"BuildId": "37670630",
"Modules":
{
"DeskMode": "UnrealEditor-DeskMode.dll"
"DeskMode": "UnrealEditor-DeskMode-0001.dll"
}
}

View File

@ -39,6 +39,15 @@ bool UGameInfoManager::LoadGameInfo()
if (UGameplayStatics::DoesSaveGameExist(SaveGameSlotName, 0))
{
PlayerInfo = Cast<UPlayerInfoSaveGame>(UGameplayStatics::LoadGameFromSlot(SaveGameSlotName, 0));
return true;
}
return false;
}
void UGameInfoManager::CreateGameInfo(UContainerInfo* ShipContainer)
{
PlayerInfo = NewObject<UPlayerInfoSaveGame>(this);
PlayerInfo->ShipContainer = ShipContainer;
PlayerInfo->ShipLevel = 99;
SaveGameInfo();
}

View File

@ -17,11 +17,15 @@ class PROJECTFISH_API UGameInfoManager : public UGameInstanceSubsystem
public:
virtual void Initialize(FSubsystemCollectionBase& Collection) override;
private:
protected:
UFUNCTION(BlueprintCallable)
void SaveGameInfo();
UFUNCTION(BlueprintCallable)
bool LoadGameInfo();
UFUNCTION(BlueprintCallable)
void CreateGameInfo(UContainerInfo* ShipContainer);
protected:
UPROPERTY(BlueprintReadOnly)
TSoftObjectPtr<class UPlayerInfoSaveGame> PlayerInfo;
TObjectPtr<class UPlayerInfoSaveGame> PlayerInfo;
static FString SaveGameSlotName;
};