修改船舱的存档功能
This commit is contained in:
parent
4f33cfbd32
commit
2c6e4f2a89
BIN
ProjectFish/Binaries/Win64/UnrealEditor-ProjectFish-0001.dll
Normal file
BIN
ProjectFish/Binaries/Win64/UnrealEditor-ProjectFish-0001.dll
Normal file
Binary file not shown.
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.
@ -2,6 +2,6 @@
|
|||||||
"BuildId": "37670630",
|
"BuildId": "37670630",
|
||||||
"Modules":
|
"Modules":
|
||||||
{
|
{
|
||||||
"DeskMode": "UnrealEditor-DeskMode.dll"
|
"DeskMode": "UnrealEditor-DeskMode-0001.dll"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -39,6 +39,15 @@ bool UGameInfoManager::LoadGameInfo()
|
|||||||
if (UGameplayStatics::DoesSaveGameExist(SaveGameSlotName, 0))
|
if (UGameplayStatics::DoesSaveGameExist(SaveGameSlotName, 0))
|
||||||
{
|
{
|
||||||
PlayerInfo = Cast<UPlayerInfoSaveGame>(UGameplayStatics::LoadGameFromSlot(SaveGameSlotName, 0));
|
PlayerInfo = Cast<UPlayerInfoSaveGame>(UGameplayStatics::LoadGameFromSlot(SaveGameSlotName, 0));
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void UGameInfoManager::CreateGameInfo(UContainerInfo* ShipContainer)
|
||||||
|
{
|
||||||
|
PlayerInfo = NewObject<UPlayerInfoSaveGame>(this);
|
||||||
|
PlayerInfo->ShipContainer = ShipContainer;
|
||||||
|
PlayerInfo->ShipLevel = 99;
|
||||||
|
SaveGameInfo();
|
||||||
|
}
|
||||||
|
|||||||
@ -17,11 +17,15 @@ class PROJECTFISH_API UGameInfoManager : public UGameInstanceSubsystem
|
|||||||
public:
|
public:
|
||||||
virtual void Initialize(FSubsystemCollectionBase& Collection) override;
|
virtual void Initialize(FSubsystemCollectionBase& Collection) override;
|
||||||
|
|
||||||
private:
|
protected:
|
||||||
|
UFUNCTION(BlueprintCallable)
|
||||||
void SaveGameInfo();
|
void SaveGameInfo();
|
||||||
|
UFUNCTION(BlueprintCallable)
|
||||||
bool LoadGameInfo();
|
bool LoadGameInfo();
|
||||||
|
UFUNCTION(BlueprintCallable)
|
||||||
|
void CreateGameInfo(UContainerInfo* ShipContainer);
|
||||||
protected:
|
protected:
|
||||||
UPROPERTY(BlueprintReadOnly)
|
UPROPERTY(BlueprintReadOnly)
|
||||||
TSoftObjectPtr<class UPlayerInfoSaveGame> PlayerInfo;
|
TObjectPtr<class UPlayerInfoSaveGame> PlayerInfo;
|
||||||
static FString SaveGameSlotName;
|
static FString SaveGameSlotName;
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user