diff --git a/ProjectFish/Binaries/Win64/UnrealEditor-ProjectFish.dll b/ProjectFish/Binaries/Win64/UnrealEditor-ProjectFish.dll index 71f0d59..4046e19 100644 Binary files a/ProjectFish/Binaries/Win64/UnrealEditor-ProjectFish.dll and b/ProjectFish/Binaries/Win64/UnrealEditor-ProjectFish.dll differ diff --git a/ProjectFish/Binaries/Win64/UnrealEditor-ProjectFishEditor.dll b/ProjectFish/Binaries/Win64/UnrealEditor-ProjectFishEditor.dll index 2284b9f..e9e7f37 100644 Binary files a/ProjectFish/Binaries/Win64/UnrealEditor-ProjectFishEditor.dll and b/ProjectFish/Binaries/Win64/UnrealEditor-ProjectFishEditor.dll differ diff --git a/ProjectFish/Content/Gameplay/BP_Dabaza_GameMode.uasset b/ProjectFish/Content/Gameplay/BP_Dabaza_GameMode.uasset index de6fa52..3d0754c 100644 Binary files a/ProjectFish/Content/Gameplay/BP_Dabaza_GameMode.uasset and b/ProjectFish/Content/Gameplay/BP_Dabaza_GameMode.uasset differ diff --git a/ProjectFish/Content/Gameplay/BagSystem/SkillAsset/AcitveSkill/Health.uasset b/ProjectFish/Content/Gameplay/BagSystem/SkillAsset/AcitveSkill/Health.uasset index 46622fa..0cbacf2 100644 Binary files a/ProjectFish/Content/Gameplay/BagSystem/SkillAsset/AcitveSkill/Health.uasset and b/ProjectFish/Content/Gameplay/BagSystem/SkillAsset/AcitveSkill/Health.uasset differ diff --git a/ProjectFish/Content/Gameplay/Fish/BP_EnemyFish.uasset b/ProjectFish/Content/Gameplay/Fish/BP_EnemyFish.uasset index c1151b9..1226cbf 100644 Binary files a/ProjectFish/Content/Gameplay/Fish/BP_EnemyFish.uasset and b/ProjectFish/Content/Gameplay/Fish/BP_EnemyFish.uasset differ diff --git a/ProjectFish/Content/Gameplay/Ship/BP_Ship.uasset b/ProjectFish/Content/Gameplay/Ship/BP_Ship.uasset index 551520c..656ee68 100644 Binary files a/ProjectFish/Content/Gameplay/Ship/BP_Ship.uasset and b/ProjectFish/Content/Gameplay/Ship/BP_Ship.uasset differ diff --git a/ProjectFish/Source/ProjectFish/Gameplay/Subsystem/FishingMapSubSystem.cpp b/ProjectFish/Source/ProjectFish/Gameplay/Subsystem/FishingMapSubSystem.cpp index 8abd880..9490294 100644 --- a/ProjectFish/Source/ProjectFish/Gameplay/Subsystem/FishingMapSubSystem.cpp +++ b/ProjectFish/Source/ProjectFish/Gameplay/Subsystem/FishingMapSubSystem.cpp @@ -4,6 +4,7 @@ #include "Engine/Engine.h" #include "Kismet/GameplayStatics.h" #include "ProjectFish/DataAsset/MapConfigAsset.h" +#include "ProjectFish/Utils/FishFunctionLibrary.h" UFishingMapNode::UFishingMapNode() { @@ -104,13 +105,22 @@ void UFishingMapSubSystem::MoveToNode(FGuid NodeID) case EMapNodeType::Battle: { FString enemyConfigPath = MapConfig->FishConfigAssets[FMath::RandRange(0, MapConfig->FishConfigAssets.Num() - 1)].GetAssetPathString(); - UGameplayStatics::OpenLevel(this, MapConfig->BattleMapName, true, "enemyConfig=" + enemyConfigPath); + TMap Options; + Options.Add("enemyConfig", enemyConfigPath); //添加敌人的配置 + Options.Add("fromMap", TEXT("MapSystemTest")); //添加战斗结束后的地图 + UFishFunctionLibrary::OpenLevelWithOptions(this, MapConfig->BattleMapName, Options); + //UGameplayStatics::OpenLevel(this, MapConfig->BattleMapName, true, "enemyConfig=" + enemyConfigPath); + break; } case EMapNodeType::Boss: { FString bossConfigPath = MapConfig->BossConfigAsset.GetAssetPathString(); - UGameplayStatics::OpenLevel(this, MapConfig->BattleMapName, true, "enemyConfig=" + bossConfigPath); + TMap Options; + Options.Add("enemyConfig", bossConfigPath); //添加敌人的配置 + Options.Add("fromMap", TEXT("MapSystemTest")); //添加战斗结束后的地图 + UFishFunctionLibrary::OpenLevelWithOptions(this, MapConfig->BattleMapName, Options); + //UGameplayStatics::OpenLevel(this, MapConfig->BattleMapName, true, "enemyConfig=" + bossConfigPath); break; } diff --git a/ProjectFish/Source/ProjectFish/Utils/FishFunctionLibrary.cpp b/ProjectFish/Source/ProjectFish/Utils/FishFunctionLibrary.cpp new file mode 100644 index 0000000..69f43d5 --- /dev/null +++ b/ProjectFish/Source/ProjectFish/Utils/FishFunctionLibrary.cpp @@ -0,0 +1,16 @@ +// Fill out your copyright notice in the Description page of Project Settings. + + +#include "FishFunctionLibrary.h" + +#include "Kismet/GameplayStatics.h" + +void UFishFunctionLibrary::OpenLevelWithOptions(const UObject* WorldContextObject, FName LevelName, TMap OptionsPaairs) +{ + FString OptionStr = ""; + for (auto optionPair: OptionsPaairs) + { + OptionStr += TEXT("?") + optionPair.Key + TEXT("=") + optionPair.Value; + } + UGameplayStatics::OpenLevel(WorldContextObject, LevelName, true,OptionStr); +} diff --git a/ProjectFish/Source/ProjectFish/Utils/FishFunctionLibrary.h b/ProjectFish/Source/ProjectFish/Utils/FishFunctionLibrary.h new file mode 100644 index 0000000..23c23be --- /dev/null +++ b/ProjectFish/Source/ProjectFish/Utils/FishFunctionLibrary.h @@ -0,0 +1,20 @@ +// Fill out your copyright notice in the Description page of Project Settings. + +#pragma once + +#include "CoreMinimal.h" +#include "Kismet/BlueprintFunctionLibrary.h" +#include "Containers/Map.h" +#include "FishFunctionLibrary.generated.h" + +/** + * + */ +UCLASS() +class PROJECTFISH_API UFishFunctionLibrary : public UBlueprintFunctionLibrary +{ + GENERATED_BODY() +public: + UFUNCTION(BlueprintCallable, Category = "FishFunctionLibrary", meta=(WorldContext="WorldContextObject")) + static void OpenLevelWithOptions(const UObject* WorldContextObject, FName LevelName,TMap OptionsPaairs); +};